rn keyboard ios doesn't focus code example
Example 1: Done button press event ReactJS keyboard PWA
The keyboard is handled by the OS (ios), it means that there are no Js events, but there are some work around to let you know when the keyboard is dismissed. Those are some suggestions:
Use Focus Events : onFocus and onBlur on your inputs
Listen on resize event in the App root component window.addEventListener('resize', updateSize);
Example 2: react native autofocus on text input with keyboard display
const [isFocused, setIsFocued] = React.useState(true)
const setFocus = React.useCallback(() => {
setIsFocued(true)
}, [])
const setBlur = React.useCallback(() => {
setIsFocued(false)
}, [])
const navi = useNavigation()
React.useEffect(() => {
navi.addListener('focus', setFocus)
navi.addListener('blur', setBlur)
return () => {
navi.removeListener('focus', setFocus)
navi.removeListener('blur', setBlur)
}
}, [])
return (
<View>
{focused && <TextInput autoFocus />}
</View>
)