about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2024-06-07 15:32:38 +0300
committerGitHub <noreply@github.com>2024-06-07 13:32:38 +0100
commit29a4a5f90c9cdea3ef30281f47cc1552570dc498 (patch)
treea501774500ff1fac19812150f9afa9d68da0dfc1
parentfefae27396d914e7b6e92cd52f300c4e919aaf65 (diff)
downloadvoidsky-29a4a5f90c9cdea3ef30281f47cc1552570dc498.tar.zst
Composer - backup android focus (#4415)
* backup android focus

* bump to 300ms just to make sure it catches all of them
-rw-r--r--src/view/com/composer/Composer.tsx13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/view/com/composer/Composer.tsx b/src/view/com/composer/Composer.tsx
index 3c2b8db2d..7872ea186 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 (
     <>
       <KeyboardAvoidingView