Skip to content

Commit

Permalink
fix:primefaces#6987 Dropdown filter freezes screen
Browse files Browse the repository at this point in the history
  • Loading branch information
kl-nevermore committed Aug 6, 2024
1 parent 0de1b70 commit 3d327db
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 3d327db

Please sign in to comment.