diff --git a/src/components/common/ChatOrUserPicker.tsx b/src/components/common/ChatOrUserPicker.tsx index c77ff427..d842ce7e 100644 --- a/src/components/common/ChatOrUserPicker.tsx +++ b/src/components/common/ChatOrUserPicker.tsx @@ -48,7 +48,10 @@ const ChatOrUserPicker: FC = ({ const lang = useLang(); const [viewportIds, getMore] = useInfiniteScroll(loadMore, chatOrUserIds, Boolean(filter)); - useInputFocusOnOpen(filterRef, isOpen, () => { onFilterChange(''); }); + const resetFilter = useCallback(() => { + onFilterChange(''); + }, [onFilterChange]); + useInputFocusOnOpen(filterRef, isOpen, resetFilter); // eslint-disable-next-line no-null/no-null const containerRef = useRef(null);