Skip to content

Commit

Permalink
fix: NetSuite - 'Select existing' invoice item option isn't highlight…
Browse files Browse the repository at this point in the history
…ed when selected.

Signed-off-by: krishna2323 <[email protected]>
  • Loading branch information
Krishna2323 committed Aug 9, 2024
1 parent 31c301e commit 6cf1f41
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={[styles.flexGrow0]}
shouldSingleExecuteRowSelect={shouldSingleExecuteRowSelect}
shouldUpdateFocusedIndex={shouldUpdateFocusedIndex}
>
<ErrorMessageRow
errors={errors}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ function NetSuiteInvoiceItemSelectPage({policy}: WithPolicyConnectionsProps) {
listEmptyContent={listEmptyContent}
connectionName={CONST.POLICY.CONNECTIONS.NAME.NETSUITE}
shouldBeBlocked={config?.invoiceItemPreference !== CONST.NETSUITE_INVOICE_ITEM_PREFERENCE.SELECT}
shouldUpdateFocusedIndex
/>
);
}
Expand Down

0 comments on commit 6cf1f41

Please sign in to comment.