Skip to content

Commit

Permalink
Merge pull request #41381 from Krishna2323/krishna2323/issue/41104
Browse files Browse the repository at this point in the history
fix: Can't drag mouse to select text in input.
  • Loading branch information
Julesssss authored May 3, 2024
2 parents 0ae357e + c9c4e27 commit a16880c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/SelectionList/BaseSelectionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ function BaseSelectionList<TItem extends ListItem>(
textInputIconLeft,
sectionTitleStyles,
textInputAutoFocus = true,
shouldTextInputInterceptSwipe = false,
}: BaseSelectionListProps<TItem>,
ref: ForwardedRef<SelectionListHandle>,
) {
Expand Down Expand Up @@ -550,6 +551,7 @@ function BaseSelectionList<TItem extends ListItem>(
blurOnSubmit={!!flattenedSections.allOptions.length}
isLoading={isLoadingNewOptions}
testID="selection-list-text-input"
shouldInterceptSwipe={shouldTextInputInterceptSwipe}
/>
</View>
)}
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 @@ -271,6 +271,9 @@ type BaseSelectionListProps<TItem extends ListItem> = Partial<ChildrenProps> & {
/** 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;

Expand Down
1 change: 1 addition & 0 deletions src/pages/NewChatPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ function NewChatPage({isGroupChat}: NewChatPageProps) {
shouldPreventDefaultFocusOnSelectRow={!DeviceCapabilities.canUseTouchScreen()}
isLoadingNewOptions={!!isSearchingForReports}
initiallyFocusedOptionKey={firstKeyForList}
shouldTextInputInterceptSwipe
/>
{isSmallScreenWidth && <OfflineIndicator />}
</KeyboardAvoidingView>
Expand Down

0 comments on commit a16880c

Please sign in to comment.