From 9b7818d358eff34276006bc242120778cb0189a1 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Sun, 5 May 2024 00:39:52 +0100 Subject: [PATCH] =?UTF-8?q?[=F0=9F=90=B4]=20Dismiss=20keyboard=20before=20?= =?UTF-8?q?opening=20convo=20menu=20(#3862)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Dismiss keyboard before opening convo menu * call `props.onPress()` instead --- src/components/dms/ConvoMenu.tsx | 7 ++++++- src/screens/Messages/Conversation/MessagesList.tsx | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/dms/ConvoMenu.tsx b/src/components/dms/ConvoMenu.tsx index 90ffedae..16306bb5 100644 --- a/src/components/dms/ConvoMenu.tsx +++ b/src/components/dms/ConvoMenu.tsx @@ -1,5 +1,5 @@ import React, {useCallback} from 'react' -import {Pressable} from 'react-native' +import {Keyboard, Pressable} from 'react-native' import {AppBskyActorDefs} from '@atproto/api' import {ChatBskyConvoDefs} from '@atproto-labs/api' import {msg, Trans} from '@lingui/macro' @@ -88,6 +88,11 @@ let ConvoMenu = ({ {({props, state}) => ( { + Keyboard.dismiss() + // eslint-disable-next-line react/prop-types -- eslint is confused by the name `props` + props.onPress() + }} style={[ a.p_sm, a.rounded_sm, diff --git a/src/screens/Messages/Conversation/MessagesList.tsx b/src/screens/Messages/Conversation/MessagesList.tsx index 73743b5f..b96dbd95 100644 --- a/src/screens/Messages/Conversation/MessagesList.tsx +++ b/src/screens/Messages/Conversation/MessagesList.tsx @@ -213,7 +213,7 @@ export function MessagesList() { contentContainerStyle={a.flex_1}> {/* This view keeps the scroll bar and content within the CenterView on web, otherwise the entire window would scroll */} {/* @ts-expect-error web only */} - + {/* Custom scroll provider so that we can use the `onScroll` event in our custom List implementation */}