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
When closing a Modal with ESC key from a Bluetooth keyboard on Android,
the modal closes natively but onRequestClose callback is not invoked.
This leaves React state out of sync.
Steps to reproduce
Run the reproducer on Android device with Bluetooth keyboard connected
Press "Open Modal" button
Press hardware BACK button or use the BACK gesture -> "onRequestClose called!" alert appears ✅
Press "Open Modal" again
Press ESC key -> Modal closes but NO alert appears ❌
Modal state is still 'true' in React but Modal is closed
Press "Open Modal" again -> Nothing happens (state is already true)
BEWARE: after the state gets stuck you cannot tap on the screen anymore, you have to reach and activate the reset state button via keyboard.
EXPECTED: ESC should call onRequestClose (like back button does)
ACTUAL: Modal closes silently without calling any callbacks
Description
When closing a Modal with ESC key from a Bluetooth keyboard on Android,
the modal closes natively but onRequestClose callback is not invoked.
This leaves React state out of sync.
Steps to reproduce
BEWARE: after the state gets stuck you cannot tap on the screen anymore, you have to reach and activate the reset state button via keyboard.
EXPECTED: ESC should call onRequestClose (like back button does)
ACTUAL: Modal closes silently without calling any callbacks
React Native Version
0.84.1
Affected Platforms
Runtime - Android
Output of
npx @react-native-community/cli infoStacktrace or Logs
MANDATORY Reproducer
https://snack.expo.dev/@andreamartinez/react-native-modal-esc-key-bug
Screenshots and Videos
In the video the first modal closing is operated via Back gesture. When you see the blue outline on the buttons I am using the keyboard.
modal-esc-bug-480.mov