Skip to content

Commit

Permalink
Merge pull request #34485 from neonbhai/scroll-behavior-fix
Browse files Browse the repository at this point in the history
Fix scroll behavior when single item is selected
  • Loading branch information
rlinoz authored Jan 26, 2024
2 parents caf91ae + a7e0e01 commit 6ec827d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/SelectionList/BaseSelectionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,11 @@ function BaseSelectionList<TItem extends User | RadioItem>(
return;
}

// scroll is unnecessary if multiple options cannot be selected
if (!canSelectMultiple) {
return;
}

// set the focus on the first item when the sections list is changed
if (sections.length > 0) {
updateAndScrollToFocusedIndex(0);
Expand Down

0 comments on commit 6ec827d

Please sign in to comment.