Skip to content

Commit 290889f

Browse files
committed
fix: Reset the current page only when text actually changes
1 parent 4bd5610 commit 290889f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/components/SelectionList/BaseSelectionList.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,9 @@ function BaseSelectionList<TItem extends ListItem>(
771771
: 0;
772772

773773
// Reset the current page to 1 when the user types something
774-
setCurrentPage(1);
774+
if (prevTextInputValue !== textInputValue) {
775+
setCurrentPage(1);
776+
}
775777

776778
updateAndScrollToFocusedIndex(newSelectedIndex);
777779
}, [

0 commit comments

Comments
 (0)