disable alt text auto focus on Android (#4198)

* disable alt text auto focus on Android

* revert timeout change
zio/stable
Hailey 2024-05-23 11:04:20 -07:00 committed by GitHub
parent 0e77280310
commit e5fc0baa6a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -20,7 +20,7 @@ import {usePalette} from 'lib/hooks/usePalette'
import {enforceLen} from 'lib/strings/helpers' import {enforceLen} from 'lib/strings/helpers'
import {gradients, s} from 'lib/styles' import {gradients, s} from 'lib/styles'
import {useTheme} from 'lib/ThemeContext' import {useTheme} from 'lib/ThemeContext'
import {isWeb} from 'platform/detection' import {isAndroid, isWeb} from 'platform/detection'
import {ImageModel} from 'state/models/media/image' import {ImageModel} from 'state/models/media/image'
import {Text} from '../util/text/Text' import {Text} from '../util/text/Text'
import {ScrollView, TextInput} from './util' import {ScrollView, TextInput} from './util'
@ -44,6 +44,7 @@ export function Component({image}: Props) {
// Autofocus hack when we open the modal. We have to wait for the animation to complete first // Autofocus hack when we open the modal. We have to wait for the animation to complete first
React.useEffect(() => { React.useEffect(() => {
if (isAndroid) return
setTimeout(() => { setTimeout(() => {
inputRef.current?.focus() inputRef.current?.focus()
}, 500) }, 500)