Composer - backup android focus (#4415)

* backup android focus

* bump to 300ms just to make sure it catches all of them
zio/stable
Samuel Newman 2024-06-07 15:32:38 +03:00 committed by GitHub
parent fefae27396
commit 29a4a5f90c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 13 additions and 0 deletions

View File

@ -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