From 29a4a5f90c9cdea3ef30281f47cc1552570dc498 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Fri, 7 Jun 2024 15:32:38 +0300 Subject: [PATCH] Composer - backup android focus (#4415) * backup android focus * bump to 300ms just to make sure it catches all of them --- src/view/com/composer/Composer.tsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/view/com/composer/Composer.tsx b/src/view/com/composer/Composer.tsx index 3c2b8db2..7872ea18 100644 --- a/src/view/com/composer/Composer.tsx +++ b/src/view/com/composer/Composer.tsx @@ -402,6 +402,19 @@ export const ComposePost = observer(function ComposePost({ bottomBarAnimatedStyle, } = useAnimatedBorders() + // Backup focus on android, if the keyboard *still* refuses to show + useEffect(() => { + if (!isAndroid) return + if (isModalReady) { + setTimeout(() => { + if (!Keyboard.isVisible()) { + textInput.current?.blur() + textInput.current?.focus() + } + }, 300) + } + }, [isModalReady]) + return ( <>