From 2c16fd8ab277fc71029c38aa37c79502fbc3ca30 Mon Sep 17 00:00:00 2001 From: "thelullabyy (via MelvinBot)" Date: Sun, 18 Oct 2026 10:59:53 +0000 Subject: [PATCH] Make the sections list keyExtractor handle a missing item FlashList can ask for the key of an index past the end of the data when the list shrinks while it is hidden by . The keyExtractor used the 'in' operator on that undefined item and crashed. Fall back to the index instead, like BaseSelectionList already does, and add regression tests. Co-authored-by: thelullabyy --- .../BaseSelectionListWithSections.tsx | 14 +- ...eSelectionListWithSectionsActivityTest.tsx | 237 ++++++++++++++++++ 2 files changed, 250 insertions(+), 1 deletion(-) create mode 100644 tests/unit/BaseSelectionListWithSectionsActivityTest.tsx diff --git a/src/components/SelectionList/SelectionListWithSections/BaseSelectionListWithSections.tsx b/src/components/SelectionList/SelectionListWithSections/BaseSelectionListWithSections.tsx index e43ca335501f..365f03ac7d81 100644 --- a/src/components/SelectionList/SelectionListWithSections/BaseSelectionListWithSections.tsx +++ b/src/components/SelectionList/SelectionListWithSections/BaseSelectionListWithSections.tsx @@ -36,6 +36,18 @@ function getItemType(item: FlattenedItem): ValueOf