diff --git a/src/components/CurrencySelectionList/index.tsx b/src/components/CurrencySelectionList/index.tsx index 01a27ff5951a..c86bc6aa2f03 100644 --- a/src/components/CurrencySelectionList/index.tsx +++ b/src/components/CurrencySelectionList/index.tsx @@ -59,7 +59,7 @@ function CurrencySelectionList({searchInputLabel, initiallySelectedCurrencyCode, textInputValue={searchValue} onChangeText={setSearchValue} onSelectRow={onSelect} - shouldDebounceRowSelect + shouldSingleExecuteRowSelect headerMessage={headerMessage} initiallyFocusedOptionKey={initiallySelectedCurrencyCode} showScrollIndicator diff --git a/src/components/MoneyRequestConfirmationList.tsx b/src/components/MoneyRequestConfirmationList.tsx index 510fc55fe0ec..af56c203c7e3 100755 --- a/src/components/MoneyRequestConfirmationList.tsx +++ b/src/components/MoneyRequestConfirmationList.tsx @@ -899,7 +899,7 @@ function MoneyRequestConfirmationList({ sections={sections} ListItem={UserListItem} onSelectRow={navigateToReportOrUserDetail} - shouldDebounceRowSelect + shouldSingleExecuteRowSelect canSelectMultiple={false} shouldPreventDefaultFocusOnSelectRow footerContent={footerContent} diff --git a/src/components/Search/index.tsx b/src/components/Search/index.tsx index 2903d45bd26f..0603fd4896e6 100644 --- a/src/components/Search/index.tsx +++ b/src/components/Search/index.tsx @@ -355,7 +355,7 @@ function Search({queryJSON, policyIDs, isCustomQuery}: SearchProps) { ListItem={ListItem} onSelectRow={openReport} getItemHeight={getItemHeightMemoized} - shouldDebounceRowSelect + shouldSingleExecuteRowSelect shouldPreventDefaultFocusOnSelectRow={!DeviceCapabilities.canUseTouchScreen()} listHeaderWrapperStyle={[styles.ph8, styles.pv3, styles.pb5]} containerStyle={[styles.pv0]} diff --git a/src/components/SelectionList/BaseSelectionList.tsx b/src/components/SelectionList/BaseSelectionList.tsx index 9fc4e05b1018..e78d3d43d1ec 100644 --- a/src/components/SelectionList/BaseSelectionList.tsx +++ b/src/components/SelectionList/BaseSelectionList.tsx @@ -1,5 +1,4 @@ import {useFocusEffect, useIsFocused} from '@react-navigation/native'; -import lodashDebounce from 'lodash/debounce'; import isEmpty from 'lodash/isEmpty'; import type {ForwardedRef} from 'react'; import React, {forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState} from 'react'; @@ -21,6 +20,7 @@ import useKeyboardShortcut from '@hooks/useKeyboardShortcut'; import useKeyboardState from '@hooks/useKeyboardState'; import useLocalize from '@hooks/useLocalize'; import usePrevious from '@hooks/usePrevious'; +import useSingleExecution from '@hooks/useSingleExecution'; import useThemeStyles from '@hooks/useThemeStyles'; import getSectionsWithIndexOffset from '@libs/getSectionsWithIndexOffset'; import Log from '@libs/Log'; @@ -40,7 +40,7 @@ function BaseSelectionList( shouldUseUserSkeletonView, canSelectMultiple = false, onSelectRow, - shouldDebounceRowSelect = false, + shouldSingleExecuteRowSelect = false, onCheckboxPress, onSelectAll, onDismissError, @@ -117,6 +117,7 @@ function BaseSelectionList( const [currentPage, setCurrentPage] = useState(1); const isTextInputFocusedRef = useRef(false); const isEmptyList = sections.length === 0; + const {singleExecution} = useSingleExecution(); const incrementPage = () => setCurrentPage((prev) => prev + 1); @@ -282,9 +283,6 @@ function BaseSelectionList( onChangeText?.(''); }, [onChangeText]); - // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps - const debouncedOnSelectRow = useCallback(lodashDebounce(onSelectRow, 200), [onSelectRow]); - /** * Logic to run when a row is selected, either with click/press or keyboard hotkeys. * @@ -315,11 +313,7 @@ function BaseSelectionList( setFocusedIndex(indexToFocus); } - if (shouldDebounceRowSelect) { - debouncedOnSelectRow(item); - } else { - onSelectRow(item); - } + onSelectRow(item); if (shouldShowTextInput && shouldPreventDefaultFocusOnSelectRow && innerTextInputRef.current) { innerTextInputRef.current.focus(); @@ -344,11 +338,6 @@ function BaseSelectionList( selectRow(focusedOption); }; - // This debounce happens on the trailing edge because on repeated enter presses, rapid component state update cancels the existing debounce and the redundant - // enter presses runs the debounced function again. - // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps - const debouncedSelectFocusedOption = useCallback(lodashDebounce(selectFocusedOption, 100), [selectFocusedOption]); - /** * This function is used to compute the layout of any given item in our list. * We need to implement it so that we can programmatically scroll to items outside the virtual render window of the SectionList. @@ -457,7 +446,13 @@ function BaseSelectionList( showTooltip={showTooltip} canSelectMultiple={canSelectMultiple} onLongPressRow={onLongPressRow} - onSelectRow={() => selectRow(item, index)} + onSelectRow={() => { + if (shouldSingleExecuteRowSelect) { + singleExecution(() => selectRow(item, index))(); + } else { + selectRow(item); + } + }} onCheckboxPress={handleOnCheckboxPress()} onDismissError={() => onDismissError?.(item)} shouldPreventDefaultFocusOnSelectRow={shouldPreventDefaultFocusOnSelectRow} @@ -513,26 +508,6 @@ function BaseSelectionList( [scrollToIndex, setFocusedIndex], ); - useEffect(() => { - if (!(shouldDebounceRowSelect && debouncedOnSelectRow.cancel)) { - return; - } - - return () => { - debouncedOnSelectRow.cancel(); - }; - }, [debouncedOnSelectRow, shouldDebounceRowSelect]); - - useEffect(() => { - if (!(shouldDebounceRowSelect && debouncedSelectFocusedOption.cancel)) { - return; - } - - return () => { - debouncedSelectFocusedOption.cancel(); - }; - }, [debouncedSelectFocusedOption, shouldDebounceRowSelect]); - /** Function to focus text input */ const focusTextInput = useCallback(() => { if (!innerTextInputRef.current) { @@ -627,7 +602,7 @@ function BaseSelectionList( useImperativeHandle(ref, () => ({scrollAndHighlightItem, clearInputAfterSelect}), [scrollAndHighlightItem, clearInputAfterSelect]); /** Selects row when pressing Enter */ - useKeyboardShortcut(CONST.KEYBOARD_SHORTCUTS.ENTER, shouldDebounceRowSelect ? debouncedSelectFocusedOption : selectFocusedOption, { + useKeyboardShortcut(CONST.KEYBOARD_SHORTCUTS.ENTER, selectFocusedOption, { captureOnInputs: true, shouldBubble: !flattenedSections.allOptions[focusedIndex], shouldStopPropagation, @@ -687,7 +662,7 @@ function BaseSelectionList( selectTextOnFocus spellCheck={false} iconLeft={textInputIconLeft} - onSubmitEditing={shouldDebounceRowSelect ? debouncedSelectFocusedOption : selectFocusedOption} + onSubmitEditing={selectFocusedOption} blurOnSubmit={!!flattenedSections.allOptions.length} isLoading={isLoadingNewOptions} testID="selection-list-text-input" diff --git a/src/components/SelectionList/types.ts b/src/components/SelectionList/types.ts index 80f8e6dda1a3..782307876e55 100644 --- a/src/components/SelectionList/types.ts +++ b/src/components/SelectionList/types.ts @@ -308,8 +308,8 @@ type BaseSelectionListProps = Partial & { /** Callback to fire when a row is pressed */ onSelectRow: (item: TItem) => void; - /** Whether to debounce `onRowSelect` */ - shouldDebounceRowSelect?: boolean; + /** Whether to single execution `onRowSelect` - workaround for unintentional multiple navigation calls https://github.com/Expensify/App/issues/44443 */ + shouldSingleExecuteRowSelect?: boolean; /** Whether to update the focused index on a row select */ shouldUpdateFocusedIndex?: boolean; diff --git a/src/components/SelectionScreen.tsx b/src/components/SelectionScreen.tsx index 45492c77ec98..baa33919c9f4 100644 --- a/src/components/SelectionScreen.tsx +++ b/src/components/SelectionScreen.tsx @@ -85,8 +85,8 @@ type SelectionScreenProps = { /** A function to run when the X button next to the error is clicked */ onClose?: () => void; - /** Whether to debounce `onRowSelect` */ - shouldDebounceRowSelect?: boolean; + /** Whether to single execute `onRowSelect` - this prevents bugs related to double interactions */ + shouldSingleExecuteRowSelect?: boolean; /** Used for dynamic header title translation with parameters */ headerTitleAlreadyTranslated?: string; @@ -112,7 +112,7 @@ function SelectionScreen({ errors, errorRowStyles, onClose, - shouldDebounceRowSelect, + shouldSingleExecuteRowSelect, headerTitleAlreadyTranslated, }: SelectionScreenProps) { const {translate} = useLocalize(); @@ -152,7 +152,7 @@ function SelectionScreen({ listEmptyContent={listEmptyContent} listFooterContent={listFooterContent} sectionListStyle={[styles.flexGrow0]} - shouldDebounceRowSelect={shouldDebounceRowSelect} + shouldSingleExecuteRowSelect={shouldSingleExecuteRowSelect} > (selectedOptions.length > 0 ? createGroup() : createChat(option))} rightHandSideComponent={itemRightSideComponent} footerContent={footerContent} diff --git a/src/pages/ReimbursementAccount/BusinessInfo/substeps/TypeBusiness/BusinessTypePicker/BusinessTypeSelectorModal.tsx b/src/pages/ReimbursementAccount/BusinessInfo/substeps/TypeBusiness/BusinessTypePicker/BusinessTypeSelectorModal.tsx index a3fc3737dbf2..45db53a23286 100644 --- a/src/pages/ReimbursementAccount/BusinessInfo/substeps/TypeBusiness/BusinessTypePicker/BusinessTypeSelectorModal.tsx +++ b/src/pages/ReimbursementAccount/BusinessInfo/substeps/TypeBusiness/BusinessTypePicker/BusinessTypeSelectorModal.tsx @@ -65,7 +65,7 @@ function BusinessTypeSelectorModal({isVisible, currentBusinessType, onBusinessTy sections={[{data: incorporationTypes}]} initiallyFocusedOptionKey={currentBusinessType} onSelectRow={onBusinessTypeSelected} - shouldDebounceRowSelect + shouldSingleExecuteRowSelect shouldStopPropagation shouldUseDynamicMaxToRenderPerBatch ListItem={RadioListItem} diff --git a/src/pages/ReportParticipantRoleSelectionPage.tsx b/src/pages/ReportParticipantRoleSelectionPage.tsx index d6f3eb9e4603..d2fb5ca365a0 100644 --- a/src/pages/ReportParticipantRoleSelectionPage.tsx +++ b/src/pages/ReportParticipantRoleSelectionPage.tsx @@ -68,7 +68,7 @@ function ReportParticipantRoleSelectionPage({report, route}: ReportParticipantRo sections={[{data: items}]} ListItem={RadioListItem} onSelectRow={changeRole} - shouldDebounceRowSelect + shouldSingleExecuteRowSelect initiallyFocusedOptionKey={items.find((item) => item.isSelected)?.keyForList} /> diff --git a/src/pages/ReportParticipantsPage.tsx b/src/pages/ReportParticipantsPage.tsx index b3d64d316196..affb561d8225 100755 --- a/src/pages/ReportParticipantsPage.tsx +++ b/src/pages/ReportParticipantsPage.tsx @@ -365,7 +365,7 @@ function ReportParticipantsPage({report}: WithReportOrNotFoundProps) { ListItem={TableListItem} headerContent={headerContent} onSelectRow={openMemberDetails} - shouldDebounceRowSelect={!(isGroupChat && isCurrentUserAdmin)} + shouldSingleExecuteRowSelect={!(isGroupChat && isCurrentUserAdmin)} onCheckboxPress={(item) => toggleUser(item)} onSelectAll={() => toggleAllUsers(participants)} showScrollIndicator diff --git a/src/pages/iou/request/MoneyRequestParticipantsSelector.tsx b/src/pages/iou/request/MoneyRequestParticipantsSelector.tsx index cb7127537c6d..6ff64128cbbc 100644 --- a/src/pages/iou/request/MoneyRequestParticipantsSelector.tsx +++ b/src/pages/iou/request/MoneyRequestParticipantsSelector.tsx @@ -424,7 +424,7 @@ function MoneyRequestParticipantsSelector({participants = CONST.EMPTY_ARRAY, onF onChangeText={setSearchTerm} shouldPreventDefaultFocusOnSelectRow={!DeviceCapabilities.canUseTouchScreen()} onSelectRow={onSelectRow} - shouldDebounceRowSelect + shouldSingleExecuteRowSelect footerContent={footerContent} headerMessage={header} showLoadingPlaceholder={!areOptionsInitialized || !didScreenTransitionEnd} diff --git a/src/pages/iou/request/step/IOURequestStepDistanceRate.tsx b/src/pages/iou/request/step/IOURequestStepDistanceRate.tsx index d21edcf9518c..44e666ce7ed5 100644 --- a/src/pages/iou/request/step/IOURequestStepDistanceRate.tsx +++ b/src/pages/iou/request/step/IOURequestStepDistanceRate.tsx @@ -119,7 +119,7 @@ function IOURequestStepDistanceRate({ sections={[{data: sections}]} ListItem={RadioListItem} onSelectRow={({value}) => selectDistanceRate(value ?? '')} - shouldDebounceRowSelect + shouldSingleExecuteRowSelect initiallyFocusedOptionKey={initiallyFocusedOption} /> diff --git a/src/pages/iou/request/step/IOURequestStepSendFrom.tsx b/src/pages/iou/request/step/IOURequestStepSendFrom.tsx index 4c22b7f37e33..7064e279ee06 100644 --- a/src/pages/iou/request/step/IOURequestStepSendFrom.tsx +++ b/src/pages/iou/request/step/IOURequestStepSendFrom.tsx @@ -92,7 +92,7 @@ function IOURequestStepSendFrom({route, transaction, allPolicies}: IOURequestSte diff --git a/src/pages/iou/request/step/IOURequestStepSplitPayer.tsx b/src/pages/iou/request/step/IOURequestStepSplitPayer.tsx index 35adfb9fb815..8236a780d970 100644 --- a/src/pages/iou/request/step/IOURequestStepSplitPayer.tsx +++ b/src/pages/iou/request/step/IOURequestStepSplitPayer.tsx @@ -87,7 +87,7 @@ function IOURequestStepSplitPayer({ sections={sections} ListItem={UserListItem} onSelectRow={setSplitPayer} - shouldDebounceRowSelect + shouldSingleExecuteRowSelect showLoadingPlaceholder={!didScreenTransitionEnd} /> diff --git a/src/pages/settings/AboutPage/ShareLogList/BaseShareLogList.tsx b/src/pages/settings/AboutPage/ShareLogList/BaseShareLogList.tsx index f0169b410257..7f753e02ee6d 100644 --- a/src/pages/settings/AboutPage/ShareLogList/BaseShareLogList.tsx +++ b/src/pages/settings/AboutPage/ShareLogList/BaseShareLogList.tsx @@ -127,7 +127,7 @@ function BaseShareLogList({onAttachLogToReport}: BaseShareLogListProps) { ListItem={UserListItem} sections={didScreenTransitionEnd ? sections : CONST.EMPTY_ARRAY} onSelectRow={attachLogToReport} - shouldDebounceRowSelect + shouldSingleExecuteRowSelect onChangeText={setSearchValue} textInputValue={searchValue} headerMessage={searchOptions.headerMessage} diff --git a/src/pages/settings/Preferences/LanguagePage.tsx b/src/pages/settings/Preferences/LanguagePage.tsx index f5c2cb4097af..dbc1440a5e67 100644 --- a/src/pages/settings/Preferences/LanguagePage.tsx +++ b/src/pages/settings/Preferences/LanguagePage.tsx @@ -31,7 +31,7 @@ function LanguagePage() { sections={[{data: localesToLanguages}]} ListItem={RadioListItem} onSelectRow={(language) => App.setLocaleAndNavigate(language.value)} - shouldDebounceRowSelect + shouldSingleExecuteRowSelect initiallyFocusedOptionKey={localesToLanguages.find((locale) => locale.isSelected)?.keyForList} /> diff --git a/src/pages/settings/Preferences/PriorityModePage.tsx b/src/pages/settings/Preferences/PriorityModePage.tsx index aef727e448f6..57f565e7dca7 100644 --- a/src/pages/settings/Preferences/PriorityModePage.tsx +++ b/src/pages/settings/Preferences/PriorityModePage.tsx @@ -58,7 +58,7 @@ function PriorityModePage() { sections={[{data: priorityModes}]} ListItem={RadioListItem} onSelectRow={updateMode} - shouldDebounceRowSelect + shouldSingleExecuteRowSelect initiallyFocusedOptionKey={priorityModes.find((mode) => mode.isSelected)?.keyForList} /> diff --git a/src/pages/settings/Preferences/ThemePage.tsx b/src/pages/settings/Preferences/ThemePage.tsx index c46e0f2abaaa..bd14c076bfb3 100644 --- a/src/pages/settings/Preferences/ThemePage.tsx +++ b/src/pages/settings/Preferences/ThemePage.tsx @@ -49,7 +49,7 @@ function ThemePage({preferredTheme}: ThemePageProps) { sections={[{data: localesToThemes}]} ListItem={RadioListItem} onSelectRow={(theme) => User.updateTheme(theme.value)} - shouldDebounceRowSelect + shouldSingleExecuteRowSelect initiallyFocusedOptionKey={localesToThemes.find((theme) => theme.isSelected)?.keyForList} /> diff --git a/src/pages/settings/Profile/PersonalDetails/CountrySelectionPage.tsx b/src/pages/settings/Profile/PersonalDetails/CountrySelectionPage.tsx index 249698e1916e..080d53dd8573 100644 --- a/src/pages/settings/Profile/PersonalDetails/CountrySelectionPage.tsx +++ b/src/pages/settings/Profile/PersonalDetails/CountrySelectionPage.tsx @@ -80,7 +80,7 @@ function CountrySelectionPage({route, navigation}: CountrySelectionPageProps) { sections={[{data: searchResults}]} ListItem={RadioListItem} onSelectRow={selectCountry} - shouldDebounceRowSelect + shouldSingleExecuteRowSelect onChangeText={setSearchValue} initiallyFocusedOptionKey={currentCountry} shouldUseDynamicMaxToRenderPerBatch diff --git a/src/pages/settings/Profile/PersonalDetails/StateSelectionPage.tsx b/src/pages/settings/Profile/PersonalDetails/StateSelectionPage.tsx index 2fad9452bd38..c04e631bd13f 100644 --- a/src/pages/settings/Profile/PersonalDetails/StateSelectionPage.tsx +++ b/src/pages/settings/Profile/PersonalDetails/StateSelectionPage.tsx @@ -105,7 +105,7 @@ function StateSelectionPage() { diff --git a/src/pages/settings/Profile/TimezoneSelectPage.tsx b/src/pages/settings/Profile/TimezoneSelectPage.tsx index fdc10b72ad43..326db5481d37 100644 --- a/src/pages/settings/Profile/TimezoneSelectPage.tsx +++ b/src/pages/settings/Profile/TimezoneSelectPage.tsx @@ -72,7 +72,7 @@ function TimezoneSelectPage({currentUserPersonalDetails}: TimezoneSelectPageProp textInputValue={timezoneInputText} onChangeText={filterShownTimezones} onSelectRow={saveSelectedTimezone} - shouldDebounceRowSelect + shouldSingleExecuteRowSelect sections={[{data: timezoneOptions, isDisabled: timezone.automatic}]} initiallyFocusedOptionKey={timezoneOptions.find((tz) => tz.text === timezone.selected)?.keyForList} showScrollIndicator diff --git a/src/pages/settings/Report/NotificationPreferencePage.tsx b/src/pages/settings/Report/NotificationPreferencePage.tsx index 186419ca3363..3a149e1ed377 100644 --- a/src/pages/settings/Report/NotificationPreferencePage.tsx +++ b/src/pages/settings/Report/NotificationPreferencePage.tsx @@ -51,7 +51,7 @@ function NotificationPreferencePage({report}: NotificationPreferencePageProps) { onSelectRow={(option) => report && ReportActions.updateNotificationPreference(report.reportID, report.notificationPreference, option.value, true, undefined, undefined, report) } - shouldDebounceRowSelect + shouldSingleExecuteRowSelect initiallyFocusedOptionKey={notificationPreferenceOptions.find((locale) => locale.isSelected)?.keyForList} /> diff --git a/src/pages/settings/Report/VisibilityPage.tsx b/src/pages/settings/Report/VisibilityPage.tsx index 76ba076138c8..6cdb8a8d828f 100644 --- a/src/pages/settings/Report/VisibilityPage.tsx +++ b/src/pages/settings/Report/VisibilityPage.tsx @@ -75,7 +75,7 @@ function VisibilityPage({report}: VisibilityProps) { } changeVisibility(option.value); }} - shouldDebounceRowSelect + shouldSingleExecuteRowSelect initiallyFocusedOptionKey={visibilityOptions.find((visibility) => visibility.isSelected)?.keyForList} ListItem={RadioListItem} /> diff --git a/src/pages/settings/Report/WriteCapabilityPage.tsx b/src/pages/settings/Report/WriteCapabilityPage.tsx index 6f8ae3d81a55..19e8c10b698b 100644 --- a/src/pages/settings/Report/WriteCapabilityPage.tsx +++ b/src/pages/settings/Report/WriteCapabilityPage.tsx @@ -55,7 +55,7 @@ function WriteCapabilityPage({report, policy}: WriteCapabilityPageProps) { sections={[{data: writeCapabilityOptions}]} ListItem={RadioListItem} onSelectRow={(option) => report && ReportActions.updateWriteCapabilityAndNavigate(report, option.value)} - shouldDebounceRowSelect + shouldSingleExecuteRowSelect initiallyFocusedOptionKey={writeCapabilityOptions.find((locale) => locale.isSelected)?.keyForList} /> diff --git a/src/pages/tasks/TaskAssigneeSelectorModal.tsx b/src/pages/tasks/TaskAssigneeSelectorModal.tsx index 11e430780c53..7404dff38937 100644 --- a/src/pages/tasks/TaskAssigneeSelectorModal.tsx +++ b/src/pages/tasks/TaskAssigneeSelectorModal.tsx @@ -239,7 +239,7 @@ function TaskAssigneeSelectorModal({reports, task}: TaskAssigneeSelectorModalPro sections={areOptionsInitialized ? sections : []} ListItem={UserListItem} onSelectRow={selectReport} - shouldDebounceRowSelect + shouldSingleExecuteRowSelect onChangeText={setSearchValue} textInputValue={searchValue} headerMessage={headerMessage} diff --git a/src/pages/tasks/TaskShareDestinationSelectorModal.tsx b/src/pages/tasks/TaskShareDestinationSelectorModal.tsx index 4367f2ccebcb..da8537227f08 100644 --- a/src/pages/tasks/TaskShareDestinationSelectorModal.tsx +++ b/src/pages/tasks/TaskShareDestinationSelectorModal.tsx @@ -138,7 +138,7 @@ function TaskShareDestinationSelectorModal() { ListItem={UserListItem} sections={areOptionsInitialized ? sections : []} onSelectRow={selectReportHandler} - shouldDebounceRowSelect + shouldSingleExecuteRowSelect onChangeText={setSearchValue} textInputValue={searchValue} headerMessage={options.header} diff --git a/src/pages/workspace/WorkspaceMembersPage.tsx b/src/pages/workspace/WorkspaceMembersPage.tsx index cbab4cac34b5..8ab1dadccb30 100644 --- a/src/pages/workspace/WorkspaceMembersPage.tsx +++ b/src/pages/workspace/WorkspaceMembersPage.tsx @@ -589,7 +589,7 @@ function WorkspaceMembersPage({personalDetails, route, policy, currentUserPerson headerMessage={getHeaderMessage()} headerContent={!shouldUseNarrowLayout && getHeaderContent()} onSelectRow={openMemberDetails} - shouldDebounceRowSelect={!isPolicyAdmin} + shouldSingleExecuteRowSelect={!isPolicyAdmin} onCheckboxPress={(item) => toggleUser(item.accountID)} onSelectAll={() => toggleAllUsers(data)} onDismissError={dismissError} diff --git a/src/pages/workspace/accounting/netsuite/import/NetSuiteImportCustomFieldNew/NetSuiteCustomListSelectorModal.tsx b/src/pages/workspace/accounting/netsuite/import/NetSuiteImportCustomFieldNew/NetSuiteCustomListSelectorModal.tsx index 3eeebbafc8a3..e8f0d9e8315f 100644 --- a/src/pages/workspace/accounting/netsuite/import/NetSuiteImportCustomFieldNew/NetSuiteCustomListSelectorModal.tsx +++ b/src/pages/workspace/accounting/netsuite/import/NetSuiteImportCustomFieldNew/NetSuiteCustomListSelectorModal.tsx @@ -98,7 +98,7 @@ function NetSuiteCustomListSelectorModal({isVisible, currentCustomListValue, onC ListItem={RadioListItem} isRowMultilineSupported initiallyFocusedOptionKey={currentCustomListValue} - shouldDebounceRowSelect + shouldSingleExecuteRowSelect shouldStopPropagation shouldUseDynamicMaxToRenderPerBatch /> diff --git a/src/pages/workspace/accounting/qbo/advanced/QuickbooksAccountSelectPage.tsx b/src/pages/workspace/accounting/qbo/advanced/QuickbooksAccountSelectPage.tsx index a02c0b76809f..bed84acfb7ce 100644 --- a/src/pages/workspace/accounting/qbo/advanced/QuickbooksAccountSelectPage.tsx +++ b/src/pages/workspace/accounting/qbo/advanced/QuickbooksAccountSelectPage.tsx @@ -92,7 +92,7 @@ function QuickbooksAccountSelectPage({policy}: WithPolicyConnectionsProps) { ListItem={RadioListItem} headerContent={listHeaderComponent} onSelectRow={saveSelection} - shouldDebounceRowSelect + shouldSingleExecuteRowSelect initiallyFocusedOptionKey={initiallyFocusedOptionKey} listEmptyContent={listEmptyContent} /> diff --git a/src/pages/workspace/accounting/qbo/advanced/QuickbooksInvoiceAccountSelectPage.tsx b/src/pages/workspace/accounting/qbo/advanced/QuickbooksInvoiceAccountSelectPage.tsx index 0459f61b88d6..69acda4e1ba6 100644 --- a/src/pages/workspace/accounting/qbo/advanced/QuickbooksInvoiceAccountSelectPage.tsx +++ b/src/pages/workspace/accounting/qbo/advanced/QuickbooksInvoiceAccountSelectPage.tsx @@ -93,7 +93,7 @@ function QuickbooksInvoiceAccountSelectPage({policy}: WithPolicyConnectionsProps ListItem={RadioListItem} headerContent={listHeaderComponent} onSelectRow={updateAccount} - shouldDebounceRowSelect + shouldSingleExecuteRowSelect initiallyFocusedOptionKey={initiallyFocusedOptionKey} listEmptyContent={listEmptyContent} /> diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectCardPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectCardPage.tsx index b1af64cb2f4b..c36f7df6b245 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectCardPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectCardPage.tsx @@ -100,7 +100,7 @@ function QuickbooksCompanyCardExpenseAccountSelectCardPage({policy}: WithPolicyC sections={sections} ListItem={RadioListItem} onSelectRow={selectExportCompanyCard} - shouldDebounceRowSelect + shouldSingleExecuteRowSelect initiallyFocusedOptionKey={sections[0].data.find((option) => option.isSelected)?.keyForList} footerContent={ isLocationEnabled && {translate('workspace.qbo.companyCardsLocationEnabledDescription')} diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectPage.tsx index 3c44888d782d..8bee7d206180 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountSelectPage.tsx @@ -97,7 +97,7 @@ function QuickbooksCompanyCardExpenseAccountSelectPage({policy}: WithPolicyConne sections={data.length ? [{data}] : []} ListItem={RadioListItem} onSelectRow={selectExportAccount} - shouldDebounceRowSelect + shouldSingleExecuteRowSelect initiallyFocusedOptionKey={data.find((mode) => mode.isSelected)?.keyForList} listEmptyContent={listEmptyContent} /> diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksExportDateSelectPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksExportDateSelectPage.tsx index 64e55edeb862..89fbd6a96b33 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksExportDateSelectPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksExportDateSelectPage.tsx @@ -58,7 +58,7 @@ function QuickbooksExportDateSelectPage({policy}: WithPolicyConnectionsProps) { sections={[{data}]} ListItem={RadioListItem} onSelectRow={selectExportDate} - shouldDebounceRowSelect + shouldSingleExecuteRowSelect initiallyFocusedOptionKey={data.find((mode) => mode.isSelected)?.keyForList} /> diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksExportInvoiceAccountSelectPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksExportInvoiceAccountSelectPage.tsx index b95e70fe11dd..e2b285fe3d41 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksExportInvoiceAccountSelectPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksExportInvoiceAccountSelectPage.tsx @@ -78,7 +78,7 @@ function QuickbooksExportInvoiceAccountSelectPage({policy}: WithPolicyConnection sections={data.length ? [{data}] : []} ListItem={RadioListItem} onSelectRow={selectExportInvoice} - shouldDebounceRowSelect + shouldSingleExecuteRowSelect initiallyFocusedOptionKey={data.find((mode) => mode.isSelected)?.keyForList} listEmptyContent={listEmptyContent} /> diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksNonReimbursableDefaultVendorSelectPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksNonReimbursableDefaultVendorSelectPage.tsx index 3c9e7c085578..d57da414b57b 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksNonReimbursableDefaultVendorSelectPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksNonReimbursableDefaultVendorSelectPage.tsx @@ -75,7 +75,7 @@ function QuickbooksNonReimbursableDefaultVendorSelectPage({policy}: WithPolicyCo sections={sections} ListItem={RadioListItem} onSelectRow={selectVendor} - shouldDebounceRowSelect + shouldSingleExecuteRowSelect initiallyFocusedOptionKey={sections[0]?.data.find((mode) => mode.isSelected)?.keyForList} listEmptyContent={listEmptyContent} /> diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseAccountSelectPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseAccountSelectPage.tsx index 50b44640642b..bc4523a034f5 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseAccountSelectPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseAccountSelectPage.tsx @@ -116,7 +116,7 @@ function QuickbooksOutOfPocketExpenseAccountSelectPage({policy}: WithPolicyConne sections={data.length ? [{data}] : []} ListItem={RadioListItem} onSelectRow={selectExportAccount} - shouldDebounceRowSelect + shouldSingleExecuteRowSelect initiallyFocusedOptionKey={data.find((mode) => mode.isSelected)?.keyForList} listEmptyContent={listEmptyContent} /> diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseEntitySelectPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseEntitySelectPage.tsx index 4843c192991f..b0d8afa6d53b 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseEntitySelectPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseEntitySelectPage.tsx @@ -120,7 +120,7 @@ function QuickbooksOutOfPocketExpenseEntitySelectPage({policy}: WithPolicyConnec sections={sections} ListItem={RadioListItem} onSelectRow={selectExportEntity} - shouldDebounceRowSelect + shouldSingleExecuteRowSelect initiallyFocusedOptionKey={data.find((mode) => mode.isSelected)?.keyForList} footerContent={