Skip to content

Commit

Permalink
Fix scrolling of country page
Browse files Browse the repository at this point in the history
  • Loading branch information
shubham1206agra committed Jan 4, 2025
1 parent 0a8574f commit da88626
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/SelectionList/BaseSelectionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -652,8 +652,9 @@ function BaseSelectionList<TItem extends ListItem>(
useEffect(() => {
// Avoid changing focus if the textInputValue remains unchanged.
if (
(prevTextInputValue === textInputValue && flattenedSections.selectedOptions.length === prevSelectedOptionsLength && !shouldUpdateFocusedIndex) ||
flattenedSections.allOptions.length === 0
(prevTextInputValue === textInputValue && flattenedSections.selectedOptions.length === prevSelectedOptionsLength) ||
flattenedSections.allOptions.length === 0 ||
(flattenedSections.selectedOptions.length !== prevSelectedOptionsLength && shouldUpdateFocusedIndex)
) {
return;
}
Expand Down

0 comments on commit da88626

Please sign in to comment.