Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
e5d2738
Add paginated tag filters with server-side search
ShridharGoel Aug 29, 2026
a847be2
Remove client-side sorting to fix infinite scroll UX
ShridharGoel Aug 29, 2026
b6af9ac
Show cached tags immediately, fetch fresh data in background
ShridharGoel Aug 29, 2026
8c29130
Fix cached data check to avoid loading spinner on remount
ShridharGoel Aug 29, 2026
16b5724
Persist tag filter pagination state in Onyx
ShridharGoel Aug 30, 2026
bb0eef2
Show Tag filter when tags are enabled for any policy
ShridharGoel Aug 30, 2026
e3419f6
Update tag filter visibility tests
ShridharGoel Aug 30, 2026
d0c95ca
Reset pagination state immediately when search query changes
ShridharGoel Aug 30, 2026
0bb24a1
fix: prevent focus loss when searching tags
ShridharGoel Aug 30, 2026
7c90110
Return hasCachedData from hook and register RAM-only pagination key
ShridharGoel Aug 30, 2026
a8d1d4d
Bucket new Onyx keys for state export and drop unused type export
ShridharGoel Aug 30, 2026
2701438
Remove unused policyID prop from TagSelector
ShridharGoel Aug 30, 2026
57d968c
Always fetch tag filters on open instead of skipping when cache exists
ShridharGoel Aug 30, 2026
92a8e50
Keep paginated tag filter selections when validating the filter form
ShridharGoel Aug 30, 2026
f1962c6
Log tag filter request failures instead of leaving unhandled rejections
ShridharGoel Aug 30, 2026
5243195
Keep the confirm footer visible while loading more tag filter pages
ShridharGoel Aug 30, 2026
b44ed4c
Trigger server-side tag search from the text change handler instead o…
ShridharGoel Aug 30, 2026
492bd05
Drop redundant useMemo around tag items now that React Compiler memoi…
ShridharGoel Aug 30, 2026
45dc453
Cancel in-flight tag filter requests when a new search supersedes them
ShridharGoel Aug 30, 2026
a0987be
Remove unused policyID param from useAdvancedSearchFilters
ShridharGoel Aug 30, 2026
2dde80a
Update useAdvancedSearchFilters tests for single-arg signature
ShridharGoel Aug 30, 2026
9801a6e
Show full-list spinner only on initial tag filter load
ShridharGoel Aug 30, 2026
d283f3d
Track completed tag search with state instead of ref
ShridharGoel Aug 30, 2026
fc95bd0
use boolean coercion for tag filter visibility
ShridharGoel Aug 31, 2026
8d783d2
drop noop fallback for debounced search callback
ShridharGoel Aug 31, 2026
a01882f
remove redundant useCallback and rename search to searchTags
ShridharGoel Aug 31, 2026
71ee4be
Type OpenSearchTagFiltersPage response locally instead of on shared R…
ShridharGoel Aug 31, 2026
320250e
Scope the tag filter search to the selected workspaces
ShridharGoel Sep 1, 2026
efe3a65
Hide the empty-tag option when it does not match the tag search
ShridharGoel Sep 1, 2026
2e3ec4e
Keep selected tags visible when they are not in the current result page
ShridharGoel Sep 1, 2026
a6a26d1
Fix the MultiSelectItem import path
ShridharGoel Sep 1, 2026
5e5c370
Merge remote-tracking branch 'origin/main' into shridhar/paginated-ta…
ShridharGoel Sep 3, 2026
4cf871d
Keep search policy tags collection in memory only
ShridharGoel Sep 3, 2026
4791524
Keep tag filter values without validating against incomplete local ta…
ShridharGoel Sep 3, 2026
b7a42d8
Fix tag order after clearing search
ShridharGoel Sep 3, 2026
fb027dc
Clear stale tag results on new search to prevent list reordering
ShridharGoel Sep 3, 2026
dae8d12
Show loading state instead of no results during tag search
ShridharGoel Sep 3, 2026
1b726ac
Suppress no results message during tag search loading
ShridharGoel Sep 3, 2026
26c2551
Show loading spinner during tag search when list is empty
ShridharGoel Sep 3, 2026
c9f17e4
Fix CI: remove unused var, defer effect setState, remove stale eslint…
ShridharGoel Sep 3, 2026
099b4d9
Skip tag filter fetch while offline, refetch on reconnect
ShridharGoel Sep 3, 2026
23ba088
Filter cached tags locally when offline
ShridharGoel Sep 3, 2026
ede8683
Fix typo: refetches to re-fetches
ShridharGoel Sep 3, 2026
a7f5227
Re-fetch active tag search query on reconnect
ShridharGoel Sep 4, 2026
af3206a
Center tag search spinner and use local filter when cache complete
ShridharGoel Sep 5, 2026
9b3d8f0
fix(search): tag filter pagination and clear search
ShridharGoel Sep 5, 2026
5fa117c
fix(search): tag filter review and search focus
ShridharGoel Sep 5, 2026
e448c84
fix(search): offline tag filter POLICY_TAGS fallback
ShridharGoel Sep 5, 2026
0b0f1dc
Merge origin/main into shridhar/paginated-tag-filters
ShridharGoel Sep 5, 2026
1e01b8b
Update useSearchTagFiltersTest.ts
ShridharGoel Sep 5, 2026
806b91a
Update MultiSelect.tsx
ShridharGoel Sep 8, 2026
9792771
Update useSearchTagFilters.ts
ShridharGoel Sep 8, 2026
c8d92db
Address review feedback for paginated tag filters
ShridharGoel Sep 8, 2026
60dee31
Fix React Compiler ref error and spelling
ShridharGoel Sep 8, 2026
8ae4c9c
Fix ESLint and React hooks in effect violations
ShridharGoel Sep 8, 2026
b036a00
feat: consume globally sorted tag filters from backend
ShridharGoel Sep 9, 2026
d24ad8d
Forward onEndReachedThreshold to tag MultiSelect
ShridharGoel Sep 9, 2026
15f7a38
Append continuation tag filter slices in Onyx
ShridharGoel Sep 9, 2026
ed9b7f6
Merge origin/main into shridhar/paginated-tag-filters
ShridharGoel Sep 18, 2026
04e9096
fix(search): resolve post-merge typecheck, jest, and knip failures
ShridharGoel Sep 18, 2026
3c16ae6
refactor(search): pass tag filter results as param instead of Onyx.co…
ShridharGoel Sep 19, 2026
8c76c79
fix(search): tolerate stale FlashList index in selection list keyExtr…
ShridharGoel Sep 19, 2026
49ebc59
fix(search): reset page-loading state when a new tag search supersede…
ShridharGoel Sep 21, 2026
c314d38
fix(search): preserve tag pagination metadata offline
ShridharGoel Sep 22, 2026
2eae746
Merge remote-tracking branch 'origin/main' into shridhar/paginated-ta…
ShridharGoel Sep 22, 2026
8eb9d29
Update useSearchTagFiltersTest.ts
ShridharGoel Sep 22, 2026
a142284
Address review comments on tag filter search
ShridharGoel Sep 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7276,6 +7276,7 @@ const CONST = {

SEARCH: {
RESULTS_PAGE_SIZE: 50,
TAG_FILTER_PAGE_SIZE: 200,
EXITING_ANIMATION_DURATION: 200,
ME: 'me',
/** How far the cursor may wander from where it last counted as moving over the advanced filter list and still count as resting */
Expand Down
8 changes: 8 additions & 0 deletions src/ONYXKEYS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ const ONYXKEYS = {
/** Boolean flag set whenever we are searching for reports in the server */
RAM_ONLY_IS_SEARCHING_FOR_REPORTS: 'isSearchingForReports',

/** Pagination state for tag filter search (hasMore, nextCursor). RAM-only so it resets on app restart. */
RAM_ONLY_SEARCH_TAG_FILTERS_PAGINATION: 'searchTagFiltersPagination',

/** Paginated tag search results. RAM-only so it resets on app restart. */
RAM_ONLY_SEARCH_TAG_FILTERS_RESULTS: 'searchTagFiltersResults',

/** Boolean flag set whenever we are searching for users in the server */
RAM_ONLY_IS_SEARCHING_FOR_USERS: 'isSearchingForUsers',

Expand Down Expand Up @@ -1782,6 +1788,8 @@ type OnyxValuesMapping = {
[ONYXKEYS.ONBOARDING_ADMINS_CHAT_REPORT_ID]: string;
[ONYXKEYS.ONBOARDING_LAST_VISITED_PATH]: string;
[ONYXKEYS.RAM_ONLY_IS_SEARCHING_FOR_REPORTS]: boolean;
[ONYXKEYS.RAM_ONLY_SEARCH_TAG_FILTERS_PAGINATION]: OnyxTypes.SearchTagFiltersPaginationState;
[ONYXKEYS.RAM_ONLY_SEARCH_TAG_FILTERS_RESULTS]: OnyxTypes.SearchTagFilterItem[];
[ONYXKEYS.RAM_ONLY_IS_SEARCHING_FOR_USERS]: boolean;
[ONYXKEYS.RAM_ONLY_IS_AUTHENTICATING_WITH_SHORT_LIVED_TOKEN]: boolean;
[ONYXKEYS.LAST_VISITED_PATH]: string | undefined;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Icon from '@components/Icon';
import {PressableWithFeedback} from '@components/Pressable';
import ScrollView from '@components/ScrollView';
import type {Filter} from '@components/Search/types';
import SpacerView from '@components/SpacerView';
import Text from '@components/Text';

Expand Down Expand Up @@ -34,7 +33,6 @@ type FilterItemCallbacks = {

type FilterListProps = FilterItemCallbacks & {
type: SearchDataTypes | undefined;
policyID: Filter;
selectedFilter?: SearchFilter['key'];
style?: StyleProp<ViewStyle>;
contentContainerStyle?: StyleProp<ViewStyle>;
Expand Down Expand Up @@ -110,9 +108,9 @@ function FilterItem({filterKey, isSelected, type, onPress, onHoverIn, onFocus}:
);
}

function FilterList({type, policyID, selectedFilter, style, contentContainerStyle, onHoverIn, onFocus, onPress, onPointerMove, onPointerLeave}: FilterListProps) {
function FilterList({type, selectedFilter, style, contentContainerStyle, onHoverIn, onFocus, onPress, onPointerMove, onPointerLeave}: FilterListProps) {
const styles = useThemeStyles();
const typeFiltersKeys = useAdvancedSearchFilters(type, policyID);
const typeFiltersKeys = useAdvancedSearchFilters(type);

return (
<ScrollView
Expand Down
82 changes: 70 additions & 12 deletions src/components/Search/FilterComponents/MultiSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import type {Icon} from '@src/types/onyx/OnyxCommon';

import type {ReactNode} from 'react';

import React, {useState} from 'react';
import React, {useEffect, useEffectEvent, useRef, useState} from 'react';
import {View} from 'react-native';

import ListFilterView from './ListFilterViewWrapper';
Expand Down Expand Up @@ -50,6 +50,21 @@ type MultiSelectProps<T> = SearchFilterCommonProps<Array<MultiSelectItem<T>>> &
loading?: boolean;

shouldShowLoadingPlaceholder?: boolean;

/** Called when the scroll position gets near the end of the list */
onEndReached?: () => void;

/** How far from the end the bottom edge of the list must be to trigger onEndReached */
onEndReachedThreshold?: number;

/** Called when the debounced search term changes */
onSearchChange?: (searchTerm: string) => void;

/** Whether more items are being loaded (shows spinner at bottom of list) */
isLoadingMore?: boolean;

/** Whether a server search is in progress (shows a centered spinner in the list area) */
isSearching?: boolean;
};

function MultiSelect<T extends string>({
Expand All @@ -66,6 +81,11 @@ function MultiSelect<T extends string>({
autoFocus,
footer,
onChange,
onEndReached,
onEndReachedThreshold,
onSearchChange,
isLoadingMore,
isSearching,
}: MultiSelectProps<T>) {
const theme = useTheme();
const shouldFooterBeInsideList = useShouldFooterBeInsideList();
Expand All @@ -75,6 +95,19 @@ function MultiSelect<T extends string>({
const [selectedItems, setSelectedItems] = useState(value);
const [searchTerm, debouncedSearchTerm, setSearchTerm] = useDebouncedState('');

const notifySearchChange = useEffectEvent((term: string) => {
onSearchChange?.(term);
});

const isFirstRender = useRef(true);
useEffect(() => {
if (isFirstRender.current) {
isFirstRender.current = false;
return;
}
notifySearchChange(debouncedSearchTerm);
}, [debouncedSearchTerm]);

// Snapshot the values selected when the filter first opened so they can be floated to the top of a long list on
// first render without repinning rows that are toggled afterwards.
// moveInitialSelectionToTop gates on the *unfiltered* items length so the decision doesn't flip as the user types,
Expand All @@ -83,9 +116,11 @@ function MultiSelect<T extends string>({
const orderedItems = moveInitialSelectionToTop(items, initialSelectedValues);

const searchLower = debouncedSearchTerm.toLowerCase();
const filteredItems = isSearchable
? orderedItems.filter((item) => item.text.toLowerCase().includes(searchLower) || item.searchableText?.toLowerCase().includes(searchLower))
: orderedItems;
// When onSearchChange is provided, the parent handles filtering (server-side search)
const filteredItems =
isSearchable && !onSearchChange
? orderedItems.filter((item) => item.text.toLowerCase().includes(searchLower) || item.searchableText?.toLowerCase().includes(searchLower))
: orderedItems;
const listData: ListItem[] = filteredItems.map((item) => ({
text: item.text,
alternateText: item.alternateText,
Expand All @@ -95,7 +130,8 @@ function MultiSelect<T extends string>({
leftElement: item.leftElement,
}));

const headerMessage = isSearchable && listData.length === 0 ? translate('common.noResultsFound') : undefined;
const shouldShowSearchSpinner = isSearching && listData.length === 0;
const headerMessage = isSearchable && listData.length === 0 && !isSearching ? translate('common.noResultsFound') : undefined;

const updateSelectedItems = (item: ListItem) => {
if (item.isSelected) {
Expand Down Expand Up @@ -125,6 +161,29 @@ function MultiSelect<T extends string>({
disableAutoFocus: !autoFocus,
};

const renderCenteredSpinner = () => (
<View style={[styles.flex1, styles.justifyContentCenter, styles.alignItemsCenter, styles.pv4]}>
<ActivityIndicator
size={CONST.ACTIVITY_INDICATOR_SIZE.LARGE}
color={theme.spinner}
/>
</View>
);

const footerContent = (
<>
{!!isLoadingMore && (
<View style={[styles.alignItemsCenter, styles.pv4]}>
<ActivityIndicator
size={CONST.ACTIVITY_INDICATOR_SIZE.SMALL}
color={theme.spinner}
/>
</View>
)}
{footer}
</>
);

return (
<ListFilterView
itemCount={listData.length}
Expand All @@ -133,12 +192,7 @@ function MultiSelect<T extends string>({
isNegatable={isNegatable}
>
{loading ? (
<View style={[styles.flex1, styles.justifyContentCenter, styles.alignItemsCenter]}>
<ActivityIndicator
size={CONST.ACTIVITY_INDICATOR_SIZE.SMALL}
color={theme.spinner}
/>
</View>
renderCenteredSpinner()
) : (
<SelectionList
shouldSingleExecuteRowSelect
Expand All @@ -149,8 +203,12 @@ function MultiSelect<T extends string>({
onSelectRow={updateSelectedItems}
textInputOptions={textInputOptions}
style={{contentContainerStyle: [styles.pb0], ...selectionListStyle}}
footerContent={footer}
footerContent={footerContent}
shouldFooterBeInsideList={shouldFooterBeInsideList}
onEndReached={onEndReached}
onEndReachedThreshold={onEndReachedThreshold}
listEmptyContent={shouldShowSearchSpinner ? renderCenteredSpinner() : undefined}
shouldShowListEmptyContent={shouldShowSearchSpinner}
/>
)}
</ListFilterView>
Expand Down
92 changes: 80 additions & 12 deletions src/components/Search/FilterComponents/TagSelector.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
import type {Filter, SearchFilterCommonProps} from '@components/Search/types';

import useLocalize from '@hooks/useLocalize';
import useNetwork from '@hooks/useNetwork';
import useOnyx from '@hooks/useOnyx';
import useSearchTagFilters from '@hooks/useSearchTagFilters';

import {getCleanedTagName, getTagNamesFromTagsLists} from '@libs/PolicyUtils';
import {getAllPolicyValues, sortOptionsWithEmptyValue} from '@libs/SearchQueryUtils';

import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import type {PolicyTagLists} from '@src/types/onyx';
import type {Policy, PolicyTagLists} from '@src/types/onyx';
import {getEmptyObject} from '@src/types/utils/EmptyObject';

import type {OnyxCollection} from 'react-native-onyx';

import React from 'react';

import type {MultiSelectItem} from './MultiSelect';

import MultiSelect from './MultiSelect';

type TagSelectorProps = SearchFilterCommonProps<string[] | undefined> & {
Expand All @@ -23,17 +27,57 @@ type TagSelectorProps = SearchFilterCommonProps<string[] | undefined> & {

function TagSelector({value = [], policyID, selectionListTextInputStyle, selectionListStyle, autoFocus, footer, onChange}: TagSelectorProps) {
const {translate, localeCompare} = useLocalize();
const [allPolicyTagLists = getEmptyObject<NonNullable<OnyxCollection<PolicyTagLists>>>()] = useOnyx(ONYXKEYS.COLLECTION.POLICY_TAGS);
const {isOffline} = useNetwork();
const [policies = getEmptyObject<NonNullable<OnyxCollection<Policy>>>()] = useOnyx(ONYXKEYS.COLLECTION.POLICY);
const [allPolicyTags = getEmptyObject<NonNullable<OnyxCollection<PolicyTagLists>>>()] = useOnyx(ONYXKEYS.COLLECTION.POLICY_TAGS);
const policyIDs = policyID?.value?.length
? getAllPolicyValues(policyID, ONYXKEYS.COLLECTION.POLICY, policies)
.map((policy) => policy.id)
.join(',')
: '';
const {searchResults, isSearching, isLoadingMore, hasMore, loadMore, searchTags, isInitialLoading, searchQuery} = useSearchTagFilters(policyIDs);

const tagItems = [{text: translate('search.noTag'), value: CONST.SEARCH.TAG_EMPTY_VALUE as string}];
const uniqueTagNames = new Set<string>(
getAllPolicyValues(policyID, ONYXKEYS.COLLECTION.POLICY_TAGS, allPolicyTagLists).flatMap((policyTags) => getTagNamesFromTagsLists(policyTags ?? {})),
);
tagItems.push(
...Array.from(uniqueTagNames)
.map((tagName) => ({text: getCleanedTagName(tagName), value: tagName}))
.toSorted((a, b) => sortOptionsWithEmptyValue(a.text.toString(), b.text.toString(), localeCompare)),
);
const hasSearchResults = !!searchResults && searchResults.length > 0;
const shouldUseOfflineFallback = isOffline && !hasSearchResults;

const tagItems: Array<MultiSelectItem<string>> = [];
const emptyTagItem = {text: translate('search.noTag'), value: CONST.SEARCH.TAG_EMPTY_VALUE as string};
Comment thread
ShridharGoel marked this conversation as resolved.
Resolved
const seenTagNames = new Set<string>();
const lowerSearchQuery = searchQuery.toLowerCase();

const addTagName = (tagName: string) => {
if (seenTagNames.has(tagName)) {
return;
}
if (lowerSearchQuery && !tagName.toLowerCase().includes(lowerSearchQuery)) {
return;
}
seenTagNames.add(tagName);
tagItems.push({text: getCleanedTagName(tagName), value: tagName});
};

if (shouldUseOfflineFallback) {
// Fall back to synced workspace tag data when the paginated search cache is empty offline.
const policyTagsLists = getAllPolicyValues(policyID?.value?.length ? policyID : undefined, ONYXKEYS.COLLECTION.POLICY_TAGS, allPolicyTags);
for (const policyTagsList of policyTagsLists) {
for (const tagName of getTagNamesFromTagsLists(policyTagsList)) {
addTagName(tagName);
}
}
tagItems.sort((a, b) => sortOptionsWithEmptyValue(a.text.toString(), b.text.toString(), localeCompare));
} else {
// Preserve backend order - backend pre-sorts tags across policies alphabetically.
// When offline the API is skipped, so cached results are filtered locally by the search query.
for (const tag of searchResults ?? []) {
addTagName(tag.tagName);
}
}

const shouldShowEmptyTagOption = !isSearching && !isInitialLoading && (!searchQuery || emptyTagItem.text.toLowerCase().includes(lowerSearchQuery));

if (shouldShowEmptyTagOption) {
tagItems.unshift(emptyTagItem);
}

const selectedTagsItems = value.map((tag) => {
if (tag === CONST.SEARCH.TAG_EMPTY_VALUE) {
Expand All @@ -42,16 +86,40 @@ function TagSelector({value = [], policyID, selectionListTextInputStyle, selecti
return {text: getCleanedTagName(tag), value: tag};
});

// Selected tags that are not in the current result page stay visible once the search is cleared, so the selection doesn't disappear from the list.
// Prepend missing selected items to the top (after "No tag") so they don't land at the bottom of the paginated list.
// Do not gate on !isSearching so they stay mounted during re-fetches without flashing.
if (!searchQuery) {
const itemValues = new Set(tagItems.map((item) => item.value));
const missingSelectedItems = selectedTagsItems.filter((selectedItem) => !itemValues.has(selectedItem.value)).toSorted((a, b) => localeCompare(a.text.toString(), b.text.toString()));

if (missingSelectedItems.length > 0) {
const insertIndex = shouldShowEmptyTagOption ? 1 : 0;
tagItems.splice(insertIndex, 0, ...missingSelectedItems);
}
}

// Keep search mounted while a query is active or in flight. Clearing results for a new search resets hasMore and tag count.
const shouldEnableSearch = shouldUseOfflineFallback
? seenTagNames.size >= CONST.STANDARD_LIST_ITEM_LIMIT || !!searchQuery
: hasMore || seenTagNames.size >= CONST.STANDARD_LIST_ITEM_LIMIT || isSearching || !!searchQuery;

return (
<MultiSelect
value={selectedTagsItems}
items={tagItems}
Comment thread
ShridharGoel marked this conversation as resolved.
Resolved
isSearchable={tagItems.length >= CONST.STANDARD_LIST_ITEM_LIMIT}
isSearchable={shouldEnableSearch}
autoFocus={autoFocus}
selectionListTextInputStyle={selectionListTextInputStyle}
selectionListStyle={selectionListStyle}
footer={footer}
onChange={(tags) => onChange(tags.map((tag) => tag.value))}
onEndReached={hasMore && !shouldUseOfflineFallback ? loadMore : undefined}
onEndReachedThreshold={0.75}
onSearchChange={searchTags}
loading={isInitialLoading}
isSearching={isSearching}
isLoadingMore={isLoadingMore}
/>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import useStyleUtils from '@hooks/useStyleUtils';
import useThemeStyles from '@hooks/useThemeStyles';
import useWindowDimensions from '@hooks/useWindowDimensions';

import {getFilterNegatableValue, hasFilterContentValuesChanged} from '@libs/SearchUIUtils';
import {hasFilterContentValuesChanged} from '@libs/SearchUIUtils';
import type {SearchFilter} from '@libs/SearchUIUtils';

import CONST from '@src/CONST';
Expand Down Expand Up @@ -196,7 +196,6 @@ function SearchAdvancedFiltersPopup({queryJSON}: SearchAdvancedFiltersPopupProps
<FilterList
style={[styles.typeFiltersPopupContainer]}
type={searchAdvancedFiltersForm?.type}
policyID={getFilterNegatableValue(CONST.SEARCH.SYNTAX_FILTER_KEYS.POLICY_ID, searchAdvancedFiltersForm)}
selectedFilter={activeFilter}
onHoverIn={hoverFilter}
onPointerMove={trackPointerMovement}
Expand Down
3 changes: 2 additions & 1 deletion src/components/SelectionList/BaseSelectionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,8 @@ function BaseSelectionListImpl({
data={data}
renderItem={renderItem}
ref={listRef}
keyExtractor={(item) => item.keyForList}
// FlashList can pass a stale index here while its render stack syncs after the dataset shrinks, so item can be undefined.
Comment thread
JS00001 marked this conversation as resolved.
Resolved
keyExtractor={(item, index) => item?.keyForList ?? index.toString()}
extraData={extraData}
ListFooterComponent={
isFooterInsideList ? (
Expand Down
Loading
Loading