From 8b6a9996a3a0cc9b1ca10e470805602794abd7cb Mon Sep 17 00:00:00 2001 From: Olgierd Date: Wed, 29 Oct 2025 13:02:26 +0100 Subject: [PATCH 1/4] Remove never used import --- src/pages/Debug/ConstantPicker.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/Debug/ConstantPicker.tsx b/src/pages/Debug/ConstantPicker.tsx index 32d6ce8cbd85..7a1becdfce89 100644 --- a/src/pages/Debug/ConstantPicker.tsx +++ b/src/pages/Debug/ConstantPicker.tsx @@ -4,7 +4,6 @@ import SelectionList from '@components/SelectionList'; import RadioListItem from '@components/SelectionList/ListItem/RadioListItem'; import type {ListItem} from '@components/SelectionList/types'; import useLocalize from '@hooks/useLocalize'; -import {search} from '@libs/actions/Search'; import tokenizedSearch from '@libs/tokenizedSearch'; import type {DebugForms} from './const'; import {DETAILS_CONSTANT_FIELDS} from './const'; From c422b952a4a585a1b1c0066014c291ff30de002b Mon Sep 17 00:00:00 2001 From: Olgierd Date: Thu, 13 Nov 2025 15:50:07 +0100 Subject: [PATCH 2/4] Make ConstantPicker use new SelectionList --- src/pages/Debug/ConstantPicker.tsx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/pages/Debug/ConstantPicker.tsx b/src/pages/Debug/ConstantPicker.tsx index a9bd8f607825..a9a5defe5a1a 100644 --- a/src/pages/Debug/ConstantPicker.tsx +++ b/src/pages/Debug/ConstantPicker.tsx @@ -1,8 +1,8 @@ import isObject from 'lodash/isObject'; import React, {useMemo, useState} from 'react'; -import SelectionList from '@components/SelectionListWithSections'; -import RadioListItem from '@components/SelectionListWithSections/RadioListItem'; -import type {ListItem} from '@components/SelectionListWithSections/types'; +import SelectionList from '@components/SelectionList'; +import RadioListItem from '@components/SelectionList/ListItem/RadioListItem'; +import type {ListItem} from '@components/SelectionList/types'; import useLocalize from '@hooks/useLocalize'; import tokenizedSearch from '@libs/tokenizedSearch'; import type {DebugForms} from './const'; @@ -55,13 +55,11 @@ function ConstantPicker({formType, fieldName, fieldValue, onSubmit}: ConstantPic return ( ); From ffbd6e0e18f9b940b42e7e61d14519f090ec30ff Mon Sep 17 00:00:00 2001 From: Olgierd Date: Fri, 14 Nov 2025 15:02:34 +0100 Subject: [PATCH 3/4] Remove unnecessary fallback --- src/pages/Debug/ConstantPicker.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/Debug/ConstantPicker.tsx b/src/pages/Debug/ConstantPicker.tsx index a9a5defe5a1a..09571316d209 100644 --- a/src/pages/Debug/ConstantPicker.tsx +++ b/src/pages/Debug/ConstantPicker.tsx @@ -59,7 +59,7 @@ function ConstantPicker({formType, fieldName, fieldValue, onSubmit}: ConstantPic textInputOptions={{value: searchValue, label: translate('common.search'), onChangeText: setSearchValue}} onSelectRow={onSubmit} ListItem={RadioListItem} - initiallyFocusedItemKey={selectedOptionKey ?? undefined} + initiallyFocusedItemKey={selectedOptionKey} isRowMultilineSupported /> ); From a945ecb47ed533bd2e71a55fc8505710dee30f81 Mon Sep 17 00:00:00 2001 From: Olgierd Date: Mon, 17 Nov 2025 13:39:36 +0100 Subject: [PATCH 4/4] Memoize the textInputOptions as suggested --- src/pages/Debug/ConstantPicker.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/pages/Debug/ConstantPicker.tsx b/src/pages/Debug/ConstantPicker.tsx index 09571316d209..49e1acb4d541 100644 --- a/src/pages/Debug/ConstantPicker.tsx +++ b/src/pages/Debug/ConstantPicker.tsx @@ -53,10 +53,19 @@ function ConstantPicker({formType, fieldName, fieldValue, onSubmit}: ConstantPic ); const selectedOptionKey = useMemo(() => sections.find((option) => option.searchText === fieldValue)?.keyForList, [sections, fieldValue]); + const textInputOptions = useMemo( + () => ({ + value: searchValue, + label: translate('common.search'), + onChangeText: setSearchValue, + }), + [searchValue, translate, setSearchValue], + ); + return (