Skip to content

Commit 26f989b

Browse files
authored
Merge pull request Expensify#65636 from callstack-internal/feat/65634-reduce-amount-of-items-per-page-of-selection-list
feat: Reduce amount of items displayed per page of SelectionList
2 parents 3756c7b + 290889f commit 26f989b

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/CONST/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5184,7 +5184,7 @@ const CONST = {
51845184
* The maximum count of items per page for SelectionList.
51855185
* When paginate, it multiplies by page number.
51865186
*/
5187-
MAX_SELECTION_LIST_PAGE_LENGTH: 500,
5187+
MAX_SELECTION_LIST_PAGE_LENGTH: 50,
51885188

51895189
/**
51905190
* Bank account names

src/components/SelectionList/BaseSelectionList.tsx

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

779779
// Reset the current page to 1 when the user types something
780-
setCurrentPage(1);
780+
if (prevTextInputValue !== textInputValue) {
781+
setCurrentPage(1);
782+
}
781783

782784
updateAndScrollToFocusedIndex(newSelectedIndex);
783785
}, [

0 commit comments

Comments
 (0)