-
-
Notifications
You must be signed in to change notification settings - Fork 613
Description
Description
Opening this issue per this related issue in the react-navigation repository.
I am building a form sheet that contains an input component for the user to write a note. I am also using the usePreventRemove hook to prevent the user from accidentally losing data if they tap the backdrop as this immediately closes and unmounts the sheet.
On Android, the usePreventRemove hook properly prevents the sheet from closing and the callback is emitted allowing me to alert the user. However on iOS, while the usePreventRemove hook does prevent sheet from closing, the callback param is not called. It's also worth noting that if you attempt to interactively dismiss the sheet, the callback is properly called. So this seems to be related to the backdrop specifically.
Note, the version of RN screens in the snack is 4.16.0 but I also reproduced the issue with the latest version, 4.20.0. For some reason the snack wasn't letting me upgrade to the latest version because it's not tested with Expo 54.
Steps to reproduce
- Open the snack in an iOS simulator
- Tap "Open sheet"
- Tap "Toggle prevent remove" in the sheet
- Tap the backdrop, notice the sheet does not dismiss but nothing is logged
- Attempt to interactively dismiss the sheet, the sheet does not dismiss and "Prevented sheet removal!" is logged
Snack or a link to a repository
https://snack.expo.dev/@iankberry/formsheet-prevent-remove-cb
Screens version
4.16.0
React Native version
0.81.5
Platforms
iOS
JavaScript runtime
Hermes
Workflow
Expo bare workflow
Architecture
Fabric (New Architecture)
Build type
Debug mode
Device
iOS simulator
Device model
No response
Acknowledgements
Yes