From c9c4e27ee37a031d2f909418ed63593243e64912 Mon Sep 17 00:00:00 2001 From: Krishna Gupta Date: Wed, 1 May 2024 10:36:54 +0530 Subject: [PATCH] fix: Can't drag mouse to select text in input. Signed-off-by: Krishna Gupta --- src/components/SelectionList/BaseSelectionList.tsx | 2 ++ src/components/SelectionList/types.ts | 3 +++ src/pages/NewChatPage.tsx | 1 + 3 files changed, 6 insertions(+) diff --git a/src/components/SelectionList/BaseSelectionList.tsx b/src/components/SelectionList/BaseSelectionList.tsx index cec5e0c12948..76c54d3c37cb 100644 --- a/src/components/SelectionList/BaseSelectionList.tsx +++ b/src/components/SelectionList/BaseSelectionList.tsx @@ -75,6 +75,7 @@ function BaseSelectionList( textInputIconLeft, sectionTitleStyles, textInputAutoFocus = true, + shouldTextInputInterceptSwipe = false, }: BaseSelectionListProps, ref: ForwardedRef, ) { @@ -550,6 +551,7 @@ function BaseSelectionList( blurOnSubmit={!!flattenedSections.allOptions.length} isLoading={isLoadingNewOptions} testID="selection-list-text-input" + shouldInterceptSwipe={shouldTextInputInterceptSwipe} /> )} diff --git a/src/components/SelectionList/types.ts b/src/components/SelectionList/types.ts index d5f33e841dba..f53abd7513b9 100644 --- a/src/components/SelectionList/types.ts +++ b/src/components/SelectionList/types.ts @@ -271,6 +271,9 @@ type BaseSelectionListProps = Partial & { /** Input mode for the text input */ inputMode?: InputModeOptions; + /** Whether the text input should intercept swipes or not */ + shouldTextInputInterceptSwipe?: boolean; + /** Item `keyForList` to focus initially */ initiallyFocusedOptionKey?: string | null; diff --git a/src/pages/NewChatPage.tsx b/src/pages/NewChatPage.tsx index b20cdfde9903..37f0c30fe5cb 100755 --- a/src/pages/NewChatPage.tsx +++ b/src/pages/NewChatPage.tsx @@ -302,6 +302,7 @@ function NewChatPage({isGroupChat}: NewChatPageProps) { shouldPreventDefaultFocusOnSelectRow={!DeviceCapabilities.canUseTouchScreen()} isLoadingNewOptions={!!isSearchingForReports} initiallyFocusedOptionKey={firstKeyForList} + shouldTextInputInterceptSwipe /> {isSmallScreenWidth && }