From b818eb6abb7f409871111eeabff4896e23a05cb9 Mon Sep 17 00:00:00 2001 From: Zuzanna Furtak Date: Tue, 18 Nov 2025 17:15:01 +0100 Subject: [PATCH 1/2] Make PushRowModal use new SelectionList --- .../PushRowWithModal/PushRowModal.tsx | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/components/PushRowWithModal/PushRowModal.tsx b/src/components/PushRowWithModal/PushRowModal.tsx index 325eb755ca737..16834f35f6c87 100644 --- a/src/components/PushRowWithModal/PushRowModal.tsx +++ b/src/components/PushRowWithModal/PushRowModal.tsx @@ -2,8 +2,8 @@ import React, {useMemo} from 'react'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; import Modal from '@components/Modal'; import ScreenWrapper from '@components/ScreenWrapper'; -import SelectionList from '@components/SelectionListWithSections'; -import RadioListItem from '@components/SelectionListWithSections/RadioListItem'; +import SelectionList from '@components/SelectionList'; +import RadioListItem from '@components/SelectionList/ListItem/RadioListItem'; import useDebouncedState from '@hooks/useDebouncedState'; import useLocalize from '@hooks/useLocalize'; import searchOptions from '@libs/searchOptions'; @@ -68,7 +68,16 @@ function PushRowModal({isVisible, selectedOption, onOptionChange, onClose, optio }; const searchResults = searchOptions(debouncedSearchValue, options); - const headerMessage = debouncedSearchValue.trim() && !searchResults.length ? translate('common.noResultsFound') : ''; + + const textInputOptions = useMemo( + () => ({ + headerMessage: debouncedSearchValue.trim() && !searchResults.length ? translate('common.noResultsFound') : '', + label: searchInputTitle, + value: searchValue, + onChangeText: setSearchValue, + }), + [debouncedSearchValue, searchInputTitle, searchResults.length, searchValue, setSearchValue, translate], + ); return ( From 168748328e239d193334a7fd8e1771fadda77ca4 Mon Sep 17 00:00:00 2001 From: Zuzanna Furtak Date: Tue, 18 Nov 2025 17:23:39 +0100 Subject: [PATCH 2/2] Fix scrolling --- src/components/PushRowWithModal/PushRowModal.tsx | 1 + src/components/SelectionList/BaseSelectionList.tsx | 2 ++ src/components/SelectionList/types.ts | 3 +++ 3 files changed, 6 insertions(+) diff --git a/src/components/PushRowWithModal/PushRowModal.tsx b/src/components/PushRowWithModal/PushRowModal.tsx index 16834f35f6c87..f31917aef148e 100644 --- a/src/components/PushRowWithModal/PushRowModal.tsx +++ b/src/components/PushRowWithModal/PushRowModal.tsx @@ -103,6 +103,7 @@ function PushRowModal({isVisible, selectedOption, onOptionChange, onClose, optio onSelectRow={handleSelectRow} textInputOptions={textInputOptions} initiallyFocusedItemKey={selectedOption} + disableMaintainingScrollPosition shouldShowTooltips={false} showScrollIndicator /> diff --git a/src/components/SelectionList/BaseSelectionList.tsx b/src/components/SelectionList/BaseSelectionList.tsx index 80c7e0bf78f06..b583f8ef36cf2 100644 --- a/src/components/SelectionList/BaseSelectionList.tsx +++ b/src/components/SelectionList/BaseSelectionList.tsx @@ -65,6 +65,7 @@ function BaseSelectionList({ showScrollIndicator = true, canSelectMultiple = false, disableKeyboardShortcuts = false, + disableMaintainingScrollPosition = false, shouldUseUserSkeletonView, shouldShowTooltips = true, shouldIgnoreFocus = false, @@ -410,6 +411,7 @@ function BaseSelectionList({ style={style?.listStyle as ViewStyle} initialScrollIndex={initialFocusedIndex} onScrollBeginDrag={onScrollBeginDrag} + maintainVisibleContentPosition={{disabled: disableMaintainingScrollPosition}} ListHeaderComponent={ <> {customListHeaderContent} diff --git a/src/components/SelectionList/types.ts b/src/components/SelectionList/types.ts index fddf503cdf2a6..2ec3636c8cdb6 100644 --- a/src/components/SelectionList/types.ts +++ b/src/components/SelectionList/types.ts @@ -111,6 +111,9 @@ type SelectionListProps = { /** Whether keyboard shortcuts should be disabled */ disableKeyboardShortcuts?: boolean; + /** Whether scroll position should change when focused item changes */ + disableMaintainingScrollPosition?: boolean; + /** Whether to use the user skeleton view */ shouldUseUserSkeletonView?: boolean;