diff --git a/src/components/SelectionList/BaseSelectionList.tsx b/src/components/SelectionList/BaseSelectionList.tsx index d2dac8df503..3a9437e16ec 100644 --- a/src/components/SelectionList/BaseSelectionList.tsx +++ b/src/components/SelectionList/BaseSelectionList.tsx @@ -450,7 +450,7 @@ function BaseSelectionList( if (shouldSingleExecuteRowSelect) { singleExecution(() => selectRow(item, index))(); } else { - selectRow(item); + selectRow(item, index); } }} onCheckboxPress={handleOnCheckboxPress()} diff --git a/src/components/SelectionScreen.tsx b/src/components/SelectionScreen.tsx index ee9233aff2f..8f6ccbf64c8 100644 --- a/src/components/SelectionScreen.tsx +++ b/src/components/SelectionScreen.tsx @@ -90,6 +90,9 @@ type SelectionScreenProps = { /** Used for dynamic header title translation with parameters */ headerTitleAlreadyTranslated?: string; + + /** Whether to update the focused index on a row select */ + shouldUpdateFocusedIndex?: boolean; }; function SelectionScreen({ @@ -114,6 +117,7 @@ function SelectionScreen({ onClose, shouldSingleExecuteRowSelect, headerTitleAlreadyTranslated, + shouldUpdateFocusedIndex = false, }: SelectionScreenProps) { const {translate} = useLocalize(); const styles = useThemeStyles(); @@ -153,6 +157,7 @@ function SelectionScreen({ listFooterContent={listFooterContent} sectionListStyle={!!sections.length && [styles.flexGrow0]} shouldSingleExecuteRowSelect={shouldSingleExecuteRowSelect} + shouldUpdateFocusedIndex={shouldUpdateFocusedIndex} > Navigation.goBack(ROUTES.POLICY_ACCOUNTING_NETSUITE_EXPORT.getRoute(policyID))} connectionName={CONST.POLICY.CONNECTIONS.NAME.NETSUITE} + shouldUpdateFocusedIndex listFooterContent={ config?.invoiceItemPreference === CONST.NETSUITE_INVOICE_ITEM_PREFERENCE.SELECT ? (