diff --git a/packages/@mantine/hooks/src/use-debounced-callback/use-debounced-callback.ts b/packages/@mantine/hooks/src/use-debounced-callback/use-debounced-callback.ts index 38589a3416..443f439b3a 100644 --- a/packages/@mantine/hooks/src/use-debounced-callback/use-debounced-callback.ts +++ b/packages/@mantine/hooks/src/use-debounced-callback/use-debounced-callback.ts @@ -15,7 +15,12 @@ export function useDebounceCallback any>( } = useCallback( (...args: Parameters) => { window.clearTimeout(debounceTimerRef.current); - const flush = () => handleCallback(...args); + const flush = () => { + if(debounceTimerRef.current !== 0) { + debounceTimerRef.current = 0 + handleCallback(...args); + } + } lastCallback.flush = flush; debounceTimerRef.current = window.setTimeout(flush, delay); },