From d189427780e856e8118067cce5962b8661538223 Mon Sep 17 00:00:00 2001 From: BrtqKr Date: Wed, 17 Jul 2024 11:52:23 +0200 Subject: [PATCH 1/7] partial removal of selection debounce --- .../SelectionList/BaseSelectionList.tsx | 37 ++----------------- src/libs/actions/Task.ts | 3 ++ 2 files changed, 7 insertions(+), 33 deletions(-) diff --git a/src/components/SelectionList/BaseSelectionList.tsx b/src/components/SelectionList/BaseSelectionList.tsx index 6cc6b403dc7a..41d6fdc5388c 100644 --- a/src/components/SelectionList/BaseSelectionList.tsx +++ b/src/components/SelectionList/BaseSelectionList.tsx @@ -282,7 +282,7 @@ function BaseSelectionList( }, [onChangeText]); // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps - const debouncedOnSelectRow = useCallback(lodashDebounce(onSelectRow, 200), [onSelectRow]); + // const debouncedOnSelectRow = useCallback(lodashDebounce(onSelectRow, 200), [onSelectRow]); /** * Logic to run when a row is selected, either with click/press or keyboard hotkeys. @@ -309,11 +309,7 @@ function BaseSelectionList( } } - if (shouldDebounceRowSelect) { - debouncedOnSelectRow(item); - } else { - onSelectRow(item); - } + onSelectRow(item); if (shouldShowTextInput && shouldPreventDefaultFocusOnSelectRow && innerTextInputRef.current) { innerTextInputRef.current.focus(); @@ -338,11 +334,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. @@ -507,26 +498,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) { @@ -621,7 +592,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, @@ -681,7 +652,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/libs/actions/Task.ts b/src/libs/actions/Task.ts index 8dcb6128b143..e8c85fada74d 100644 --- a/src/libs/actions/Task.ts +++ b/src/libs/actions/Task.ts @@ -777,6 +777,7 @@ function setAssigneeValue( if (!isCurrentUser) { // Check for the chatReport by participants IDs if (!report) { + // here report = ReportUtils.getChatByParticipants([assigneeAccountID, currentUserAccountID]); } // If chat report is still not found we need to build new optimistic chat report @@ -784,6 +785,8 @@ function setAssigneeValue( report = setNewOptimisticAssignee(assigneeEmail, assigneeAccountID).assigneeReport; } + // here + // The optimistic field may not exist in the existing report and it can be overridden by the optimistic field of previous report data when merging the assignee chat report // Therefore, we should add these optimistic fields here to prevent incorrect merging, which could lead to the creation of duplicate actions for an existing report setAssigneeChatReport({ From 72b4f6f144eaf7d371ae7cea98c8dbd3c16d8079 Mon Sep 17 00:00:00 2001 From: BrtqKr Date: Wed, 17 Jul 2024 11:52:49 +0200 Subject: [PATCH 2/7] cleanup --- src/components/SelectionList/BaseSelectionList.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/SelectionList/BaseSelectionList.tsx b/src/components/SelectionList/BaseSelectionList.tsx index 41d6fdc5388c..3ea3ba4365cd 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'; From 5739398ddc644337b009e7ab99198fe5fe703218 Mon Sep 17 00:00:00 2001 From: BrtqKr Date: Wed, 17 Jul 2024 13:34:56 +0200 Subject: [PATCH 3/7] apply useSingleExecution --- src/components/SelectionList/BaseSelectionList.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/SelectionList/BaseSelectionList.tsx b/src/components/SelectionList/BaseSelectionList.tsx index 3ea3ba4365cd..cb8c4dfc45e9 100644 --- a/src/components/SelectionList/BaseSelectionList.tsx +++ b/src/components/SelectionList/BaseSelectionList.tsx @@ -20,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'; @@ -115,6 +116,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); @@ -442,7 +444,7 @@ function BaseSelectionList( canSelectMultiple={canSelectMultiple} onLongPressRow={onLongPressRow} isMobileSelectionModeActive={isMobileSelectionModeActive} - onSelectRow={() => selectRow(item)} + onSelectRow={singleExecution(() => selectRow(item))} onCheckboxPress={handleOnCheckboxPress()} onDismissError={() => onDismissError?.(item)} shouldPreventDefaultFocusOnSelectRow={shouldPreventDefaultFocusOnSelectRow} From 8b73a0a435ec6ecd9e49390a5667b57b9d58594f Mon Sep 17 00:00:00 2001 From: BrtqKr Date: Mon, 22 Jul 2024 09:24:53 +0200 Subject: [PATCH 4/7] cleanup --- .../CurrencySelectionList/index.tsx | 2 +- .../MoneyRequestConfirmationList.tsx | 2 +- src/components/Search/index.tsx | 2 +- .../SelectionList/BaseSelectionList.tsx | 13 ++++++++----- src/components/SelectionList/types.ts | 19 ++++++++++--------- src/libs/actions/Task.ts | 3 --- src/pages/ChatFinderPage/index.tsx | 2 +- src/pages/NewChatPage.tsx | 2 +- .../BusinessTypeSelectorModal.tsx | 2 +- .../ReportParticipantRoleSelectionPage.tsx | 2 +- src/pages/ReportParticipantsPage.tsx | 2 +- .../MoneyRequestParticipantsSelector.tsx | 2 +- .../step/IOURequestStepDistanceRate.tsx | 2 +- .../request/step/IOURequestStepSendFrom.tsx | 2 +- .../request/step/IOURequestStepSplitPayer.tsx | 2 +- .../ShareLogList/BaseShareLogList.tsx | 2 +- .../settings/Preferences/LanguagePage.tsx | 2 +- .../settings/Preferences/PriorityModePage.tsx | 2 +- src/pages/settings/Preferences/ThemePage.tsx | 2 +- .../PersonalDetails/CountrySelectionPage.tsx | 2 +- .../PersonalDetails/StateSelectionPage.tsx | 2 +- src/pages/settings/Profile/PronounsPage.tsx | 2 +- .../settings/Profile/TimezoneSelectPage.tsx | 2 +- .../Report/NotificationPreferencePage.tsx | 2 +- src/pages/settings/Report/VisibilityPage.tsx | 2 +- .../settings/Report/WriteCapabilityPage.tsx | 2 +- src/pages/tasks/TaskAssigneeSelectorModal.tsx | 2 +- .../TaskShareDestinationSelectorModal.tsx | 2 +- src/pages/workspace/WorkspaceMembersPage.tsx | 2 +- .../NetSuiteCustomListSelectorModal.tsx | 2 +- .../advanced/QuickbooksAccountSelectPage.tsx | 2 +- .../QuickbooksInvoiceAccountSelectPage.tsx | 2 +- ...ompanyCardExpenseAccountSelectCardPage.tsx | 2 +- ...oksCompanyCardExpenseAccountSelectPage.tsx | 2 +- .../export/QuickbooksExportDateSelectPage.tsx | 2 +- ...ickbooksExportInvoiceAccountSelectPage.tsx | 2 +- ...NonReimbursableDefaultVendorSelectPage.tsx | 2 +- ...oksOutOfPocketExpenseAccountSelectPage.tsx | 2 +- ...ooksOutOfPocketExpenseEntitySelectPage.tsx | 2 +- ...ooksPreferredExporterConfigurationPage.tsx | 2 +- ...roMapTrackingCategoryConfigurationPage.tsx | 2 +- .../XeroOrganizationConfigurationPage.tsx | 2 +- .../workspace/card/issueNew/LimitTypeStep.tsx | 2 +- ...rkspaceMemberDetailsRoleSelectionModal.tsx | 2 +- .../ReportFieldsListValuesPage.tsx | 1 - .../workspace/tags/WorkspaceTagsPage.tsx | 2 +- ...orkspaceAutoReportingMonthlyOffsetPage.tsx | 2 +- .../WorkspaceWorkflowsApproverPage.tsx | 2 +- .../workflows/WorkspaceWorkflowsPayerPage.tsx | 2 +- 49 files changed, 63 insertions(+), 63 deletions(-) diff --git a/src/components/CurrencySelectionList/index.tsx b/src/components/CurrencySelectionList/index.tsx index bfe4578afd0f..b2f48e2b0f9a 100644 --- a/src/components/CurrencySelectionList/index.tsx +++ b/src/components/CurrencySelectionList/index.tsx @@ -48,7 +48,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 ae8cbe4298f2..047b341eac90 100755 --- a/src/components/MoneyRequestConfirmationList.tsx +++ b/src/components/MoneyRequestConfirmationList.tsx @@ -877,7 +877,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 78992496f031..73dfde10439d 100644 --- a/src/components/Search/index.tsx +++ b/src/components/Search/index.tsx @@ -214,7 +214,7 @@ function Search({query, policyIDs, sortBy, sortOrder, isMobileSelectionModeActiv 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 cb8c4dfc45e9..72776554024c 100644 --- a/src/components/SelectionList/BaseSelectionList.tsx +++ b/src/components/SelectionList/BaseSelectionList.tsx @@ -40,7 +40,7 @@ function BaseSelectionList( shouldUseUserSkeletonView, canSelectMultiple = false, onSelectRow, - shouldDebounceRowSelect = false, + shouldSingleExecuteRowSelect = false, onCheckboxPress, onSelectAll, onDismissError, @@ -282,9 +282,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. * @@ -444,7 +441,13 @@ function BaseSelectionList( canSelectMultiple={canSelectMultiple} onLongPressRow={onLongPressRow} isMobileSelectionModeActive={isMobileSelectionModeActive} - onSelectRow={singleExecution(() => selectRow(item))} + onSelectRow={() => { + if (shouldSingleExecuteRowSelect) { + singleExecution(() => selectRow(item)); + } else { + selectRow(item); + } + }} onCheckboxPress={handleOnCheckboxPress()} onDismissError={() => onDismissError?.(item)} shouldPreventDefaultFocusOnSelectRow={shouldPreventDefaultFocusOnSelectRow} diff --git a/src/components/SelectionList/types.ts b/src/components/SelectionList/types.ts index 723e48699b3c..a31388322edc 100644 --- a/src/components/SelectionList/types.ts +++ b/src/components/SelectionList/types.ts @@ -1,12 +1,12 @@ -import type {MutableRefObject, ReactElement, ReactNode} from 'react'; -import type {GestureResponderEvent, InputModeOptions, LayoutChangeEvent, SectionListData, StyleProp, TextInput, TextStyle, ViewStyle} from 'react-native'; -import type {BrickRoad} from '@libs/WorkspacesSettingsUtils'; +import type { MutableRefObject, ReactElement, ReactNode } from 'react'; +import type { GestureResponderEvent, InputModeOptions, LayoutChangeEvent, SectionListData, StyleProp, TextInput, TextStyle, ViewStyle } from 'react-native'; +import type { BrickRoad } from '@libs/WorkspacesSettingsUtils'; // eslint-disable-next-line no-restricted-imports import type CursorStyles from '@styles/utils/cursor/types'; import type CONST from '@src/CONST'; -import type {Errors, Icon, PendingAction} from '@src/types/onyx/OnyxCommon'; -import type {SearchAccountDetails, SearchReport, SearchTransaction} from '@src/types/onyx/SearchResults'; -import type {ReceiptErrors} from '@src/types/onyx/Transaction'; +import type { Errors, Icon, PendingAction } from '@src/types/onyx/OnyxCommon'; +import type { SearchAccountDetails, SearchReport, SearchTransaction } from '@src/types/onyx/SearchResults'; +import type { ReceiptErrors } from '@src/types/onyx/Transaction'; import type ChildrenProps from '@src/types/utils/ChildrenProps'; import type IconAsset from '@src/types/utils/IconAsset'; import type InviteMemberListItem from './InviteMemberListItem'; @@ -16,6 +16,7 @@ import type TransactionListItem from './Search/TransactionListItem'; import type TableListItem from './TableListItem'; import type UserListItem from './UserListItem'; + type TRightHandSideComponent = { /** Component to display on the right side */ rightHandSideComponent?: ((item: TItem) => ReactElement | null | undefined) | ReactElement | null; @@ -302,8 +303,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; /** Optional callback function triggered upon pressing a checkbox. If undefined and the list displays checkboxes, checkbox interactions are managed by onSelectRow, allowing for pressing anywhere on the list. */ onCheckboxPress?: (item: TItem) => void; @@ -532,4 +533,4 @@ export type { TransactionListItemType, UserListItemProps, ValidListItem, -}; +}; \ No newline at end of file diff --git a/src/libs/actions/Task.ts b/src/libs/actions/Task.ts index e8c85fada74d..8dcb6128b143 100644 --- a/src/libs/actions/Task.ts +++ b/src/libs/actions/Task.ts @@ -777,7 +777,6 @@ function setAssigneeValue( if (!isCurrentUser) { // Check for the chatReport by participants IDs if (!report) { - // here report = ReportUtils.getChatByParticipants([assigneeAccountID, currentUserAccountID]); } // If chat report is still not found we need to build new optimistic chat report @@ -785,8 +784,6 @@ function setAssigneeValue( report = setNewOptimisticAssignee(assigneeEmail, assigneeAccountID).assigneeReport; } - // here - // The optimistic field may not exist in the existing report and it can be overridden by the optimistic field of previous report data when merging the assignee chat report // Therefore, we should add these optimistic fields here to prevent incorrect merging, which could lead to the creation of duplicate actions for an existing report setAssigneeChatReport({ diff --git a/src/pages/ChatFinderPage/index.tsx b/src/pages/ChatFinderPage/index.tsx index cb3d0b1eafd9..1ae1a54dcafd 100644 --- a/src/pages/ChatFinderPage/index.tsx +++ b/src/pages/ChatFinderPage/index.tsx @@ -188,7 +188,7 @@ function ChatFinderPage({betas, isSearchingForReports, navigation}: ChatFinderPa headerMessage={headerMessage} onLayout={setPerformanceTimersEnd} onSelectRow={selectReport} - shouldDebounceRowSelect + shouldSingleExecuteRowSelect showLoadingPlaceholder={!areOptionsInitialized || !isScreenTransitionEnd} footerContent={!isDismissed && ChatFinderPageFooterInstance} isLoadingNewOptions={!!isSearchingForReports} diff --git a/src/pages/NewChatPage.tsx b/src/pages/NewChatPage.tsx index 17baddd39251..33c345c12ea3 100755 --- a/src/pages/NewChatPage.tsx +++ b/src/pages/NewChatPage.tsx @@ -337,7 +337,7 @@ function NewChatPage({isGroupChat}: NewChatPageProps) { textInputLabel={translate('selectionList.nameEmailOrPhoneNumber')} headerMessage={headerMessage} onSelectRow={createChat} - shouldDebounceRowSelect + shouldSingleExecuteRowSelect onConfirm={(e, option) => (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 15dd063ec6ee..5eebf8c9a4d8 100755 --- a/src/pages/ReportParticipantsPage.tsx +++ b/src/pages/ReportParticipantsPage.tsx @@ -353,7 +353,7 @@ function ReportParticipantsPage({report, personalDetails, session}: ReportPartic ListItem={TableListItem} headerContent={headerContent} onSelectRow={openMemberDetails} - shouldDebounceRowSelect={!(isGroupChat && isCurrentUserAdmin)} + shouldSingleExecuteRowSelect={!(isGroupChat && isCurrentUserAdmin)} onCheckboxPress={(item) => toggleUser(item.accountID)} onSelectAll={() => toggleAllUsers(participants)} showScrollIndicator diff --git a/src/pages/iou/request/MoneyRequestParticipantsSelector.tsx b/src/pages/iou/request/MoneyRequestParticipantsSelector.tsx index 5f10b403f5e9..019326851437 100644 --- a/src/pages/iou/request/MoneyRequestParticipantsSelector.tsx +++ b/src/pages/iou/request/MoneyRequestParticipantsSelector.tsx @@ -421,7 +421,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 4f70d3e4fee9..c68c0606d62c 100644 --- a/src/pages/iou/request/step/IOURequestStepDistanceRate.tsx +++ b/src/pages/iou/request/step/IOURequestStepDistanceRate.tsx @@ -102,7 +102,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 74a1370fb00c..7ff4124d0871 100644 --- a/src/pages/iou/request/step/IOURequestStepSendFrom.tsx +++ b/src/pages/iou/request/step/IOURequestStepSendFrom.tsx @@ -90,7 +90,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 fca23d1e1cb9..d51da52d7f38 100644 --- a/src/pages/settings/AboutPage/ShareLogList/BaseShareLogList.tsx +++ b/src/pages/settings/AboutPage/ShareLogList/BaseShareLogList.tsx @@ -105,7 +105,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 9e50644cce99..ff3cf90382c0 100644 --- a/src/pages/settings/Report/NotificationPreferencePage.tsx +++ b/src/pages/settings/Report/NotificationPreferencePage.tsx @@ -47,7 +47,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 98a12a321be1..47b1bc80ca96 100644 --- a/src/pages/tasks/TaskAssigneeSelectorModal.tsx +++ b/src/pages/tasks/TaskAssigneeSelectorModal.tsx @@ -220,7 +220,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 c486e5b294c3..661149db5fcc 100644 --- a/src/pages/tasks/TaskShareDestinationSelectorModal.tsx +++ b/src/pages/tasks/TaskShareDestinationSelectorModal.tsx @@ -108,7 +108,7 @@ function TaskShareDestinationSelectorModal() { ListItem={UserListItem} sections={areOptionsInitialized ? options.sections : []} onSelectRow={selectReportHandler} - shouldDebounceRowSelect + shouldSingleExecuteRowSelect onChangeText={setSearchValue} textInputValue={searchValue} headerMessage={options.headerMessage} diff --git a/src/pages/workspace/WorkspaceMembersPage.tsx b/src/pages/workspace/WorkspaceMembersPage.tsx index adbf5a664c82..1dee97d42eb8 100644 --- a/src/pages/workspace/WorkspaceMembersPage.tsx +++ b/src/pages/workspace/WorkspaceMembersPage.tsx @@ -579,7 +579,7 @@ function WorkspaceMembersPage({personalDetails, invitedEmailsToAccountIDsDraft, headerMessage={getHeaderMessage()} headerContent={!isSmallScreenWidth && 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={