From 03407f38143b6e7b6f6904dc359be89761cabd14 Mon Sep 17 00:00:00 2001 From: Paul D'Ambra Date: Thu, 5 Oct 2023 12:04:43 +0100 Subject: [PATCH] fix: debounce console log search (#17799) --- .../filters/AdvancedSessionRecordingsFilters.tsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/frontend/src/scenes/session-recordings/filters/AdvancedSessionRecordingsFilters.tsx b/frontend/src/scenes/session-recordings/filters/AdvancedSessionRecordingsFilters.tsx index c4bc649e05073..c6debeab21c8d 100644 --- a/frontend/src/scenes/session-recordings/filters/AdvancedSessionRecordingsFilters.tsx +++ b/frontend/src/scenes/session-recordings/filters/AdvancedSessionRecordingsFilters.tsx @@ -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, @@ -156,6 +157,12 @@ function ConsoleFilters({ } } + const [onInputDebounced] = useDebounce((s: string): void => { + setFilters({ + console_search_query: s, + }) + }, 250) + return ( <> Filter by console logs @@ -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} />