From 6cf1f41337241f56035b5fc252b1b088bbbe340d Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Fri, 9 Aug 2024 15:32:28 +0530 Subject: [PATCH 1/2] fix: NetSuite - 'Select existing' invoice item option isn't highlighted when selected. Signed-off-by: krishna2323 --- src/components/SelectionList/BaseSelectionList.tsx | 2 +- src/components/SelectionScreen.tsx | 5 +++++ .../netsuite/export/NetSuiteInvoiceItemSelectPage.tsx | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/SelectionList/BaseSelectionList.tsx b/src/components/SelectionList/BaseSelectionList.tsx index e78d3d43d1ec..c43da789737a 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 baa33919c9f4..2f2473c235ab 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={[styles.flexGrow0]} shouldSingleExecuteRowSelect={shouldSingleExecuteRowSelect} + shouldUpdateFocusedIndex={shouldUpdateFocusedIndex} > ); } From 6cf59fe4672e3ec7022a9e36f557ba0a330243cf Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Fri, 9 Aug 2024 15:38:50 +0530 Subject: [PATCH 2/2] minor fix. Signed-off-by: krishna2323 --- .../netsuite/export/NetSuiteInvoiceItemPreferenceSelectPage.tsx | 1 + .../accounting/netsuite/export/NetSuiteInvoiceItemSelectPage.tsx | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/workspace/accounting/netsuite/export/NetSuiteInvoiceItemPreferenceSelectPage.tsx b/src/pages/workspace/accounting/netsuite/export/NetSuiteInvoiceItemPreferenceSelectPage.tsx index fe8e9b7e4d70..73a452c81745 100644 --- a/src/pages/workspace/accounting/netsuite/export/NetSuiteInvoiceItemPreferenceSelectPage.tsx +++ b/src/pages/workspace/accounting/netsuite/export/NetSuiteInvoiceItemPreferenceSelectPage.tsx @@ -79,6 +79,7 @@ function NetSuiteInvoiceItemPreferenceSelectPage({policy}: WithPolicyConnections featureName={CONST.POLICY.MORE_FEATURES.ARE_CONNECTIONS_ENABLED} onBackButtonPress={() => 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 ? ( ); }