keep trying to open keyboard until it's open
This commit is contained in:
@@ -155,10 +155,16 @@ export const ComposePost = observer(function ComposePost({
|
|||||||
const [labels, setLabels] = useState<string[]>([])
|
const [labels, setLabels] = useState<string[]>([])
|
||||||
const [threadgate, setThreadgate] = useState<ThreadgateSetting[]>([])
|
const [threadgate, setThreadgate] = useState<ThreadgateSetting[]>([])
|
||||||
|
|
||||||
React.useEffect(() => {
|
useEffect(() => {
|
||||||
if (!isAndroid) return
|
if (!isAndroid) return
|
||||||
const id = setTimeout(() => textInput.current?.focus(), 100)
|
const id = setInterval(() => {
|
||||||
return () => clearTimeout(id)
|
if (Keyboard.isVisible()) {
|
||||||
|
clearInterval(id)
|
||||||
|
} else {
|
||||||
|
textInput.current?.focus()
|
||||||
|
}
|
||||||
|
}, 50)
|
||||||
|
return () => clearInterval(id)
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
const gallery = useMemo(
|
const gallery = useMemo(
|
||||||
@@ -181,9 +187,7 @@ export const ComposePost = observer(function ComposePost({
|
|||||||
const onPressCancel = useCallback(() => {
|
const onPressCancel = useCallback(() => {
|
||||||
if (graphemeLength > 0 || !gallery.isEmpty || extGif) {
|
if (graphemeLength > 0 || !gallery.isEmpty || extGif) {
|
||||||
closeAllDialogs()
|
closeAllDialogs()
|
||||||
if (Keyboard) {
|
|
||||||
Keyboard.dismiss()
|
Keyboard.dismiss()
|
||||||
}
|
|
||||||
discardPromptControl.open()
|
discardPromptControl.open()
|
||||||
} else {
|
} else {
|
||||||
onClose()
|
onClose()
|
||||||
|
|||||||
Reference in New Issue
Block a user