diff --git a/components/lib/dropdown/Dropdown.js b/components/lib/dropdown/Dropdown.js index 1d98fb1703..ca0cb1e871 100644 --- a/components/lib/dropdown/Dropdown.js +++ b/components/lib/dropdown/Dropdown.js @@ -989,6 +989,10 @@ export const Dropdown = React.memo( } }, [overlayVisibleState, filterState, props.filter]); + useUpdateEffect(() => { + virtualScrollerRef.current && virtualScrollerRef.current.scrollInView(0); + }, [filterState]); + useUpdateEffect(() => { if (filterState && (!props.options || props.options.length === 0)) { setFilterState(''); diff --git a/components/lib/dropdown/DropdownPanel.js b/components/lib/dropdown/DropdownPanel.js index 0ac2945cd7..48a375f91d 100644 --- a/components/lib/dropdown/DropdownPanel.js +++ b/components/lib/dropdown/DropdownPanel.js @@ -50,7 +50,6 @@ export const DropdownPanel = React.memo( }; const onFilterInputChange = (event) => { - props.virtualScrollerRef.current && props.virtualScrollerRef.current.scrollToIndex(0); props.onFilterInputChange && props.onFilterInputChange(event); };