Skip to content

Commit

Permalink
Merge pull request #47144 from Krishna2323/krishna2323/issue/46767_2
Browse files Browse the repository at this point in the history
fix: NetSuite - 'Select existing' invoice item option isn't highlighted when selected.
  • Loading branch information
AndrewGable authored Aug 14, 2024
2 parents fcf4b4f + 6cf59fe commit d4d5a25
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/SelectionList/BaseSelectionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ function BaseSelectionList<TItem extends ListItem>(
if (shouldSingleExecuteRowSelect) {
singleExecution(() => selectRow(item, index))();
} else {
selectRow(item);
selectRow(item, index);
}
}}
onCheckboxPress={handleOnCheckboxPress()}
Expand Down
5 changes: 5 additions & 0 deletions src/components/SelectionScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ type SelectionScreenProps<T = string> = {

/** Used for dynamic header title translation with parameters */
headerTitleAlreadyTranslated?: string;

/** Whether to update the focused index on a row select */
shouldUpdateFocusedIndex?: boolean;
};

function SelectionScreen<T = string>({
Expand All @@ -114,6 +117,7 @@ function SelectionScreen<T = string>({
onClose,
shouldSingleExecuteRowSelect,
headerTitleAlreadyTranslated,
shouldUpdateFocusedIndex = false,
}: SelectionScreenProps<T>) {
const {translate} = useLocalize();
const styles = useThemeStyles();
Expand Down Expand Up @@ -153,6 +157,7 @@ function SelectionScreen<T = string>({
listFooterContent={listFooterContent}
sectionListStyle={!!sections.length && [styles.flexGrow0]}
shouldSingleExecuteRowSelect={shouldSingleExecuteRowSelect}
shouldUpdateFocusedIndex={shouldUpdateFocusedIndex}
>
<ErrorMessageRow
errors={errors}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ? (
<OfflineWithFeedback
Expand Down

0 comments on commit d4d5a25

Please sign in to comment.