Skip to content

Commit

Permalink
fix: debounce console log search (#17799)
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldambra authored Oct 5, 2023
1 parent ab5a7d4 commit 03407f3
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { teamLogic } from 'scenes/teamLogic'
import { useValues } from 'kea'
import { FEATURE_FLAGS } from 'lib/constants'
import { FlaggedFeature } from 'lib/components/FlaggedFeature'
import { useDebounce } from 'use-debounce'

export const AdvancedSessionRecordingsFilters = ({
filters,
Expand Down Expand Up @@ -156,6 +157,12 @@ function ConsoleFilters({
}
}

const [onInputDebounced] = useDebounce((s: string): void => {
setFilters({
console_search_query: s,
})
}, 250)

return (
<>
<LemonLabel>Filter by console logs</LemonLabel>
Expand All @@ -165,11 +172,7 @@ function ConsoleFilters({
className={'grow'}
placeholder={'containing text'}
value={filters.console_search_query}
onChange={(s) => {
setFilters({
console_search_query: s,
})
}}
onChange={onInputDebounced}
/>

<Tooltip
Expand Down

0 comments on commit 03407f3

Please sign in to comment.