Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix double click navigating twice on lists #25604

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
ae5a99f
Added debounce row selection prop to selection list
huzaifa-99 Aug 21, 2023
9213d0d
Updated pages to use debounced onSelectRow on selection list for side…
huzaifa-99 Aug 21, 2023
e2ea627
Added debounce row selection prop to options list
huzaifa-99 Aug 21, 2023
4754aa7
Updated pages to use debounced onSelectRow on options list for side e…
huzaifa-99 Aug 21, 2023
c289d5a
Added debounce row selection prop to options selector
huzaifa-99 Aug 21, 2023
54e0fe0
Updated pages to use debounced onSelectRow on options selector for si…
huzaifa-99 Aug 21, 2023
fc64f73
Updated debounce callback in option row
huzaifa-99 Aug 21, 2023
6e3c7ac
Fix lint
huzaifa-99 Aug 21, 2023
e50bb84
Fix lint
huzaifa-99 Aug 21, 2023
4adf263
Fix debounced onSelectRow implementation in OptionRow
huzaifa-99 Aug 21, 2023
d375d2d
Removed extra call to onSelectRow
huzaifa-99 Aug 21, 2023
8edf17f
Merge branch 'main' into 24074-fix-double-click-navigating-twice
huzaifa-99 Aug 22, 2023
7be2135
Updated new selection list to conditionally debounce onSelectRow
huzaifa-99 Aug 22, 2023
3f6942d
Merge branch 'Expensify:main' into 24074-fix-double-click-navigating-…
huzaifa-99 Aug 24, 2023
c57dbba
Added debounced row select to ThemePage
huzaifa-99 Aug 28, 2023
9d0d697
Added debounced row select to CategoryPicker
huzaifa-99 Aug 28, 2023
3712746
Updated early return syntax
huzaifa-99 Aug 28, 2023
995f33d
Added comment explaining updateOnSelectRow in OptionRow
huzaifa-99 Aug 28, 2023
0abd5d2
Cancel debounced function version when props change
huzaifa-99 Aug 28, 2023
5cfe674
Merge branch 'main' into 24074-fix-double-click-navigating-twice
huzaifa-99 Aug 28, 2023
329767c
Removed unnecessary callback
huzaifa-99 Aug 28, 2023
b2b25fa
Updated comments lettercase
huzaifa-99 Aug 28, 2023
44c5f32
Fixed comment syntax
huzaifa-99 Aug 28, 2023
1f2d67a
Remove eslint disable rule
huzaifa-99 Aug 28, 2023
2f67ee0
Merge branch 'main' into 24074-fix-double-click-navigating-twice
huzaifa-99 Sep 12, 2023
27f5aca
Merge branch 'main' into 24074-fix-double-click-navigating-twice
huzaifa-99 Sep 13, 2023
9cb54b1
Merge branch 'main' into 24074-fix-double-click-navigating-twice
huzaifa-99 Sep 27, 2023
f5aaccc
Added debounce for arrow selection on selection list
huzaifa-99 Sep 27, 2023
57696cc
Added row select debounce on tag picker
huzaifa-99 Sep 27, 2023
dec4563
Merge branch 'main' into 24074-fix-double-click-navigating-twice
huzaifa-99 Oct 2, 2023
e93c2ab
Merge branch 'main' into 24074-fix-double-click-navigating-twice
huzaifa-99 Oct 5, 2023
21ce3df
Updated debounce function
huzaifa-99 Oct 9, 2023
bee6f1a
Merge branch 'main' into 24074-fix-double-click-navigating-twice
huzaifa-99 Oct 9, 2023
2b81ebf
Use seperate callback for debounced func
huzaifa-99 Oct 11, 2023
0434a68
Merge branch 'main' into 24074-fix-double-click-navigating-twice
huzaifa-99 Oct 11, 2023
e987f14
Merge branch 'main' into 24074-fix-double-click-navigating-twice
huzaifa-99 Dec 12, 2023
ce8e6e6
Merge branch 'main' into 24074-fix-double-click-navigating-twice
huzaifa-99 Dec 21, 2023
4c9668e
Merge branch 'main' into 24074-fix-double-click-navigating-twice
huzaifa-99 Jan 23, 2024
fe8f185
Added single execution logic on web
huzaifa-99 Jan 24, 2024
4e71b31
Removed debounced onRowSelect from OptionsList, OptionsSelector and O…
huzaifa-99 Jan 24, 2024
f410673
Added shouldDebounceRowSelect on all SelectionLists with single item …
huzaifa-99 Jan 24, 2024
f668b79
Merge branch 'main' into 24074-fix-double-click-navigating-twice
huzaifa-99 Jan 24, 2024
d0ea9f3
Merge branch 'main' into 24074-fix-double-click-navigating-twice
huzaifa-99 Jan 24, 2024
3940e32
Merge branch 'main' into 24074-fix-double-click-navigating-twice
huzaifa-99 Jan 29, 2024
019e706
Fix type export
huzaifa-99 Jan 29, 2024
855a7f3
Merge branch 'main' into 24074-fix-double-click-navigating-twice
huzaifa-99 Feb 7, 2024
1a69275
Fix type
huzaifa-99 Feb 7, 2024
2d46d87
Merge branch 'main' into 24074-fix-double-click-navigating-twice
huzaifa-99 Feb 29, 2024
dfe0c26
Revert useSingleExecution on web
huzaifa-99 Mar 1, 2024
403d15f
Merge branch 'main' into 24074-fix-double-click-navigating-twice
huzaifa-99 Mar 1, 2024
bfd87a2
Lint
huzaifa-99 Mar 1, 2024
2f8f685
Added shouldDebounceRowSelect to new pages
huzaifa-99 Mar 1, 2024
1aff45b
Merge branch 'main' into 24074-fix-double-click-navigating-twice
huzaifa-99 Apr 2, 2024
dda25b6
Added debounce to new components
huzaifa-99 Apr 2, 2024
762c3b4
Merge branch 'main' into 24074-fix-double-click-navigating-twice
huzaifa-99 May 17, 2024
f626b5e
Added `shouldDebounceRowSelect` to newer components
huzaifa-99 May 17, 2024
1e5c77f
Merge branch 'main' into 24074-fix-double-click-navigating-twice
huzaifa-99 May 26, 2024
7c9240b
Removed unnecessary logical check
huzaifa-99 May 26, 2024
8dcd282
Updated comment
huzaifa-99 May 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/components/CurrencySelectionList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ function CurrencySelectionList({searchInputLabel, initiallySelectedCurrencyCode,
textInputValue={searchValue}
onChangeText={setSearchValue}
onSelectRow={onSelect}
shouldDebounceRowSelect
headerMessage={headerMessage}
initiallyFocusedOptionKey={initiallySelectedCurrencyCode}
showScrollIndicator
Expand Down
2 changes: 1 addition & 1 deletion src/components/MenuItemGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import useWaitForNavigation from '@hooks/useWaitForNavigation';

type MenuItemGroupContextProps = {
isExecuting: boolean;
singleExecution: <T extends unknown[]>(action?: Action<T> | undefined) => (...params: T) => void;
singleExecution: <T extends unknown[]>(action: Action<T>) => (...params: T) => void;
waitForNavigate: ReturnType<typeof useWaitForNavigation>;
};

Expand Down
1 change: 1 addition & 0 deletions src/components/MoneyRequestConfirmationList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1237,6 +1237,7 @@ function MoneyRequestConfirmationList({
sections={sections}
ListItem={UserListItem}
onSelectRow={navigateToReportOrUserDetail}
shouldDebounceRowSelect
canSelectMultiple={false}
shouldPreventDefaultFocusOnSelectRow
footerContent={footerContent}
Expand Down
1 change: 1 addition & 0 deletions src/components/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ function Search({query, policyIDs}: SearchProps) {
onSelectRow={(item) => {
openReport(item.transactionThreadReportID);
}}
shouldDebounceRowSelect
shouldPreventDefaultFocusOnSelectRow={!DeviceCapabilities.canUseTouchScreen()}
listHeaderWrapperStyle={[styles.ph9, styles.pv3, styles.pb5]}
containerStyle={[styles.pv0]}
Expand Down
40 changes: 37 additions & 3 deletions src/components/SelectionList/BaseSelectionList.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
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';
Expand Down Expand Up @@ -35,6 +36,7 @@ function BaseSelectionList<TItem extends ListItem>(
ListItem,
canSelectMultiple = false,
onSelectRow,
shouldDebounceRowSelect = false,
onCheckboxPress,
onSelectAll,
onDismissError,
Expand Down Expand Up @@ -252,6 +254,9 @@ function BaseSelectionList<TItem extends ListItem>(
isFocused,
});

// eslint-disable-next-line react-hooks/exhaustive-deps
const debouncedOnSelectRow = useCallback(lodashDebounce(onSelectRow, 1000, {leading: true}), [onSelectRow]);

/**
* Logic to run when a row is selected, either with click/press or keyboard hotkeys.
*
Expand All @@ -273,7 +278,11 @@ function BaseSelectionList<TItem extends ListItem>(
}
}

onSelectRow(item);
if (shouldDebounceRowSelect) {
debouncedOnSelectRow(item);
} else {
onSelectRow(item);
}

if (shouldShowTextInput && shouldPreventDefaultFocusOnSelectRow && innerTextInputRef.current) {
innerTextInputRef.current.focus();
Expand All @@ -298,6 +307,11 @@ function BaseSelectionList<TItem extends ListItem>(
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-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.
Expand Down Expand Up @@ -450,6 +464,26 @@ function BaseSelectionList<TItem extends ListItem>(
[scrollToIndex, setFocusedIndex],
);

useEffect(() => {
if (!(shouldDebounceRowSelect && debouncedOnSelectRow.cancel)) {
return;
}

return () => {
debouncedOnSelectRow.cancel();
};
}, [debouncedOnSelectRow, shouldDebounceRowSelect]);

useEffect(() => {
if (!(shouldDebounceRowSelect && debouncedSelectFocusedOption.cancel)) {
return;
}

return () => {
debouncedSelectFocusedOption.cancel();
};
}, [debouncedSelectFocusedOption, shouldDebounceRowSelect]);

/** Focuses the text input when the component comes into focus and after any navigation animations finish. */
useFocusEffect(
useCallback(() => {
Expand Down Expand Up @@ -539,7 +573,7 @@ function BaseSelectionList<TItem extends ListItem>(
useImperativeHandle(ref, () => ({scrollAndHighlightItem}), [scrollAndHighlightItem]);

/** Selects row when pressing Enter */
useKeyboardShortcut(CONST.KEYBOARD_SHORTCUTS.ENTER, selectFocusedOption, {
useKeyboardShortcut(CONST.KEYBOARD_SHORTCUTS.ENTER, shouldDebounceRowSelect ? debouncedSelectFocusedOption : selectFocusedOption, {
captureOnInputs: true,
shouldBubble: !flattenedSections.allOptions[focusedIndex],
shouldStopPropagation,
Expand Down Expand Up @@ -599,7 +633,7 @@ function BaseSelectionList<TItem extends ListItem>(
selectTextOnFocus
spellCheck={false}
iconLeft={textInputIconLeft}
onSubmitEditing={selectFocusedOption}
onSubmitEditing={shouldDebounceRowSelect ? debouncedSelectFocusedOption : selectFocusedOption}
blurOnSubmit={!!flattenedSections.allOptions.length}
isLoading={isLoadingNewOptions}
testID="selection-list-text-input"
Expand Down
3 changes: 3 additions & 0 deletions src/components/SelectionList/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,9 @@ type BaseSelectionListProps<TItem extends ListItem> = Partial<ChildrenProps> & {
/** Callback to fire when a row is pressed */
onSelectRow: (item: TItem) => void;

/** Whether to debounce `onRowSelect` */
shouldDebounceRowSelect?: 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;

Expand Down
1 change: 1 addition & 0 deletions src/pages/ChatFinderPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ function ChatFinderPage({betas, isSearchingForReports, navigation}: ChatFinderPa
headerMessage={headerMessage}
onLayout={setPerformanceTimersEnd}
onSelectRow={selectReport}
shouldDebounceRowSelect
showLoadingPlaceholder={!areOptionsInitialized || !isScreenTransitionEnd}
footerContent={!isDismissed && ChatFinderPageFooterInstance}
isLoadingNewOptions={!!isSearchingForReports}
Expand Down
1 change: 1 addition & 0 deletions src/pages/NewChatPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ function NewChatPage({isGroupChat}: NewChatPageProps) {
textInputLabel={translate('selectionList.nameEmailOrPhoneNumber')}
headerMessage={headerMessage}
onSelectRow={createChat}
shouldDebounceRowSelect
onConfirm={(e, option) => (selectedOptions.length > 0 ? createGroup() : createChat(option))}
rightHandSideComponent={itemRightSideComponent}
footerContent={footerContent}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ function BusinessTypeSelectorModal({isVisible, currentBusinessType, onBusinessTy
sections={[{data: incorporationTypes}]}
initiallyFocusedOptionKey={currentBusinessType}
onSelectRow={onBusinessTypeSelected}
shouldDebounceRowSelect
shouldStopPropagation
shouldUseDynamicMaxToRenderPerBatch
ListItem={RadioListItem}
Expand Down
1 change: 1 addition & 0 deletions src/pages/ReportParticipantRoleSelectionPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ function ReportParticipantRoleSelectionPage({report, route}: ReportParticipantRo
sections={[{data: items}]}
ListItem={RadioListItem}
onSelectRow={changeRole}
shouldDebounceRowSelect
initiallyFocusedOptionKey={items.find((item) => item.isSelected)?.keyForList}
/>
</View>
Expand Down
1 change: 1 addition & 0 deletions src/pages/ReportParticipantsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ function ReportParticipantsPage({report, personalDetails, session}: ReportPartic
ListItem={TableListItem}
headerContent={headerContent}
onSelectRow={openMemberDetails}
shouldDebounceRowSelect={!(isGroupChat && isCurrentUserAdmin)}
onCheckboxPress={(item) => toggleUser(item.accountID)}
onSelectAll={() => toggleAllUsers(participants)}
showScrollIndicator
Expand Down
1 change: 1 addition & 0 deletions src/pages/WorkspaceSwitcherPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ function WorkspaceSwitcherPage() {
ListItem={UserListItem}
sections={sections}
onSelectRow={selectPolicy}
shouldDebounceRowSelect
textInputLabel={usersWorkspaces.length >= CONST.WORKSPACE_SWITCHER.MINIMUM_WORKSPACES_TO_SHOW_SEARCH ? translate('common.search') : undefined}
textInputValue={searchTerm}
onChangeText={setSearchTerm}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ function MoneyRequestParticipantsSelector({participants = [], onFinish, onPartic
onChangeText={setSearchTerm}
shouldPreventDefaultFocusOnSelectRow={!DeviceCapabilities.canUseTouchScreen()}
onSelectRow={(item) => (isIOUSplit ? addParticipantToSelection(item) : addSingleParticipant(item))}
shouldDebounceRowSelect
footerContent={footerContent}
headerMessage={headerMessage}
showLoadingPlaceholder={!areOptionsInitialized || !didScreenTransitionEnd}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ function IOURequestStepDistanceRate({
sections={[{data: sections}]}
ListItem={RadioListItem}
onSelectRow={({value}) => selectDistanceRate(value ?? '')}
shouldDebounceRowSelect
initiallyFocusedOptionKey={initiallyFocusedOption}
/>
</StepScreenWrapper>
Expand Down
1 change: 1 addition & 0 deletions src/pages/iou/request/step/IOURequestStepSendFrom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ function IOURequestStepSendFrom({route, transaction, allPolicies}: IOURequestSte
<SelectionList
sections={[{data: workspaceOptions, title: translate('common.workspaces')}]}
onSelectRow={selectWorkspace}
shouldDebounceRowSelect
ListItem={UserListItem}
initiallyFocusedOptionKey={selectedWorkspace?.policyID}
/>
Expand Down
1 change: 1 addition & 0 deletions src/pages/iou/request/step/IOURequestStepSplitPayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ function IOURequestStepSplitPayer({
sections={sections}
ListItem={UserListItem}
onSelectRow={setSplitPayer}
shouldDebounceRowSelect
showLoadingPlaceholder={!didScreenTransitionEnd}
/>
</StepScreenWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ function BaseShareLogList({onAttachLogToReport}: BaseShareLogListProps) {
ListItem={UserListItem}
sections={didScreenTransitionEnd ? sections : CONST.EMPTY_ARRAY}
onSelectRow={attachLogToReport}
shouldDebounceRowSelect
onChangeText={setSearchValue}
textInputValue={searchValue}
headerMessage={searchOptions.headerMessage}
Expand Down
1 change: 1 addition & 0 deletions src/pages/settings/Preferences/LanguagePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ function LanguagePage() {
sections={[{data: localesToLanguages}]}
ListItem={RadioListItem}
onSelectRow={(language) => App.setLocaleAndNavigate(language.value)}
shouldDebounceRowSelect
initiallyFocusedOptionKey={localesToLanguages.find((locale) => locale.isSelected)?.keyForList}
/>
</ScreenWrapper>
Expand Down
1 change: 1 addition & 0 deletions src/pages/settings/Preferences/PriorityModePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ function PriorityModePage() {
sections={[{data: priorityModes}]}
ListItem={RadioListItem}
onSelectRow={updateMode}
shouldDebounceRowSelect
initiallyFocusedOptionKey={priorityModes.find((mode) => mode.isSelected)?.keyForList}
/>
</ScreenWrapper>
Expand Down
1 change: 1 addition & 0 deletions src/pages/settings/Preferences/ThemePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ function ThemePage({preferredTheme}: ThemePageProps) {
sections={[{data: localesToThemes}]}
ListItem={RadioListItem}
onSelectRow={(theme) => User.updateTheme(theme.value)}
shouldDebounceRowSelect
initiallyFocusedOptionKey={localesToThemes.find((theme) => theme.isSelected)?.keyForList}
/>
</ScreenWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ function CountrySelectionPage({route, navigation}: CountrySelectionPageProps) {
sections={[{data: searchResults}]}
ListItem={RadioListItem}
onSelectRow={selectCountry}
shouldDebounceRowSelect
onChangeText={setSearchValue}
initiallyFocusedOptionKey={currentCountry}
shouldUseDynamicMaxToRenderPerBatch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ function StateSelectionPage() {

<SelectionList
onSelectRow={selectCountryState}
shouldDebounceRowSelect
headerMessage={headerMessage}
// Label can be an empty string
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
Expand Down
1 change: 1 addition & 0 deletions src/pages/settings/Profile/PronounsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ function PronounsPage({currentUserPersonalDetails, isLoadingApp = true}: Pronoun
sections={[{data: filteredPronounsList}]}
ListItem={RadioListItem}
onSelectRow={updatePronouns}
shouldDebounceRowSelect
onChangeText={setSearchValue}
initiallyFocusedOptionKey={currentPronounsKey}
/>
Expand Down
1 change: 1 addition & 0 deletions src/pages/settings/Profile/TimezoneSelectPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ function TimezoneSelectPage({currentUserPersonalDetails}: TimezoneSelectPageProp
textInputValue={timezoneInputText}
onChangeText={filterShownTimezones}
onSelectRow={saveSelectedTimezone}
shouldDebounceRowSelect
sections={[{data: timezoneOptions, isDisabled: timezone.automatic}]}
initiallyFocusedOptionKey={timezoneOptions.find((tz) => tz.text === timezone.selected)?.keyForList}
showScrollIndicator
Expand Down
1 change: 1 addition & 0 deletions src/pages/settings/Report/NotificationPreferencePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ function NotificationPreferencePage({report}: NotificationPreferencePageProps) {
onSelectRow={(option) =>
report && ReportActions.updateNotificationPreference(report.reportID, report.notificationPreference, option.value, true, undefined, undefined, report)
}
shouldDebounceRowSelect
initiallyFocusedOptionKey={notificationPreferenceOptions.find((locale) => locale.isSelected)?.keyForList}
/>
</FullPageNotFoundView>
Expand Down
1 change: 1 addition & 0 deletions src/pages/settings/Report/VisibilityPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ function VisibilityPage({report}: VisibilityProps) {
}
changeVisibility(option.value);
}}
shouldDebounceRowSelect
initiallyFocusedOptionKey={visibilityOptions.find((visibility) => visibility.isSelected)?.keyForList}
ListItem={RadioListItem}
/>
Expand Down
1 change: 1 addition & 0 deletions src/pages/settings/Report/WriteCapabilityPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ function WriteCapabilityPage({report, policy}: WriteCapabilityPageProps) {
sections={[{data: writeCapabilityOptions}]}
ListItem={RadioListItem}
onSelectRow={(option) => report && ReportActions.updateWriteCapabilityAndNavigate(report, option.value)}
shouldDebounceRowSelect
initiallyFocusedOptionKey={writeCapabilityOptions.find((locale) => locale.isSelected)?.keyForList}
/>
</FullPageNotFoundView>
Expand Down
1 change: 1 addition & 0 deletions src/pages/tasks/TaskAssigneeSelectorModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ function TaskAssigneeSelectorModal({reports, task}: TaskAssigneeSelectorModalPro
sections={areOptionsInitialized ? sections : []}
ListItem={UserListItem}
onSelectRow={selectReport}
shouldDebounceRowSelect
onChangeText={setSearchValue}
textInputValue={searchValue}
headerMessage={headerMessage}
Expand Down
1 change: 1 addition & 0 deletions src/pages/tasks/TaskShareDestinationSelectorModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ function TaskShareDestinationSelectorModal() {
ListItem={UserListItem}
sections={areOptionsInitialized ? options.sections : []}
onSelectRow={selectReportHandler}
shouldDebounceRowSelect
onChangeText={setSearchValue}
textInputValue={searchValue}
headerMessage={options.headerMessage}
Expand Down
1 change: 1 addition & 0 deletions src/pages/workspace/WorkspaceMembersPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,7 @@ function WorkspaceMembersPage({personalDetails, invitedEmailsToAccountIDsDraft,
headerMessage={getHeaderMessage()}
headerContent={!isSmallScreenWidth && getHeaderContent()}
onSelectRow={openMemberDetails}
shouldDebounceRowSelect={!isPolicyAdmin}
onCheckboxPress={(item) => toggleUser(item.accountID)}
onSelectAll={() => toggleAllUsers(data)}
onDismissError={dismissError}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ function QuickbooksAccountSelectPage({policy}: WithPolicyConnectionsProps) {
ListItem={RadioListItem}
headerContent={listHeaderComponent}
onSelectRow={saveSelection}
shouldDebounceRowSelect
initiallyFocusedOptionKey={initiallyFocusedOptionKey}
/>
</ScreenWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ function QuickbooksInvoiceAccountSelectPage({policy}: WithPolicyConnectionsProps
ListItem={RadioListItem}
headerContent={listHeaderComponent}
onSelectRow={updateAccount}
shouldDebounceRowSelect
initiallyFocusedOptionKey={initiallyFocusedOptionKey}
/>
</ScreenWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ function QuickbooksCompanyCardExpenseAccountSelectCardPage({policy}: WithPolicyC
sections={sections}
ListItem={RadioListItem}
onSelectRow={selectExportCompanyCard}
shouldDebounceRowSelect
initiallyFocusedOptionKey={sections[0].data.find((option) => option.isSelected)?.keyForList}
footerContent={
isLocationEnabled && <Text style={[styles.mutedNormalTextLabel, styles.pt2]}>{translate('workspace.qbo.companyCardsLocationEnabledDescription')}</Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ function QuickbooksCompanyCardExpenseAccountSelectPage({policy}: WithPolicyConne
sections={[{data}]}
ListItem={RadioListItem}
onSelectRow={selectExportAccount}
shouldDebounceRowSelect
initiallyFocusedOptionKey={data.find((mode) => mode.isSelected)?.keyForList}
/>
</ScreenWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ function QuickbooksExportDateSelectPage({policy}: WithPolicyConnectionsProps) {
sections={[{data}]}
ListItem={RadioListItem}
onSelectRow={selectExportDate}
shouldDebounceRowSelect
initiallyFocusedOptionKey={data.find((mode) => mode.isSelected)?.keyForList}
/>
</ScreenWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ function QuickbooksExportInvoiceAccountSelectPage({policy}: WithPolicyConnection
sections={[{data}]}
ListItem={RadioListItem}
onSelectRow={selectExportInvoice}
shouldDebounceRowSelect
initiallyFocusedOptionKey={data.find((mode) => mode.isSelected)?.keyForList}
/>
</ScreenWrapper>
Expand Down
Loading
Loading