Debounced auto-submit for GIF search field

This commit is contained in:
Lim Chee Aun 2024-04-17 08:26:35 +08:00
parent 55ad6500bc
commit b9058c6e3d

View file

@ -2374,6 +2374,10 @@ function GIFPickerModal({ onClose = () => {}, onSelect = () => {} }) {
qRef.current?.focus();
}, []);
const debouncedOnInput = useDebouncedCallback(() => {
fetchGIFs({ offset: 0 });
}, 1000);
return (
<div id="gif-picker-sheet" class="sheet">
{!!onClose && (
@ -2400,6 +2404,7 @@ function GIFPickerModal({ onClose = () => {}, onSelect = () => {} }) {
autocapitalize="off"
spellCheck="false"
dir="auto"
onInput={debouncedOnInput}
/>
<input
type="image"