You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug KeyboardController.dismiss stays pending until the first time the keyboard is dismissed, resolves right after the first time the keyboard is dismissed, then after that it would work as expected (when it's called, it dismisses the keyboard if it's shown, then resolves).
Code snippet
import{Alert}from'react-native';import{KeyboardController}from'react-native-keyboard-controller';// inside the component call this and pay attention to when alert showsKeyboardController.dismiss().then(()=>Alert.alert('Dismissed'))
when the app is started, press on the TouchableOpacity to dismiss the keyboard
notice that the callback is not called (Alert is not shown)
press on the TextInput to focus it
press out of the TextInput to blur it and dismiss the keyboard
notice that the callback is called (Alert is shown)
now press on the TouchableOpacity to dismiss the keyboard, notice that the callback is called (Alert is shown) no matter if the keyboard is shown or not
Expected behavior
when KeyboardController.dismiss is called, it dismisses the keyboard if it's shown, then resolves, not depending on if the keyboard was dismissed before or not
Describe the bug
KeyboardController.dismiss
stays pending until the first time the keyboard is dismissed, resolves right after the first time the keyboard is dismissed, then after that it would work as expected (when it's called, it dismisses the keyboard if it's shown, then resolves).Code snippet
Repo for reproducing
https://github.com/liao02x/react-native-keyboard-controller_keyboard-dismiss-issue-repro
To Reproduce
* It's also in repo readme
TouchableOpacity
to dismiss the keyboardTextInput
to focus itTextInput
to blur it and dismiss the keyboardTouchableOpacity
to dismiss the keyboard, notice that the callback is called (Alert is shown) no matter if the keyboard is shown or notExpected behavior
when
KeyboardController.dismiss
is called, it dismisses the keyboard if it's shown, then resolves, not depending on if the keyboard was dismissed before or notScreenshots
Simulator.Screen.Recording.-.iPhone.12.mini.-.2025-03-12.at.22.15.47.mp4
Smartphone (please complete the following information):
The text was updated successfully, but these errors were encountered: