Skip to content

Commit

Permalink
fix:#6987 Dropdown filter freezes screen (#6991)
Browse files Browse the repository at this point in the history
  • Loading branch information
kl-nevermore authored Aug 6, 2024
1 parent a7c99b3 commit 9d86edb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 4 additions & 0 deletions components/lib/dropdown/Dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -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('');
Expand Down
1 change: 0 additions & 1 deletion components/lib/dropdown/DropdownPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

Expand Down

0 comments on commit 9d86edb

Please sign in to comment.