react-native-screens icon indicating copy to clipboard operation
react-native-screens copied to clipboard

feat(iOS): introduce modal dismiss event on drag down attempt

Open gtokman opened this issue 1 year ago • 1 comments

Description

As described in this discussion, this PR intercepts the event when a user tries to drag down the view, allowing to perform additional actions, such as displaying an Action Sheet for confirmation.

Changes

  • Updated types.tsx
  • RNSScreen.h
  • RNSScreen.mm

Screenshots / GIFs

https://github.com/software-mansion/react-native-screens/assets/12258850/469aa86a-a79f-4a0d-a08b-37b82f1fcf20

Test code and steps to reproduce

Not yet, but requires gestureEnabled: false and onModalDismiss: () => showActionSheet()

Checklist

  • [ ] Included code example that can be used to test this change
  • [x] Updated TS types
  • [ ] Updated documentation:
    • [ ] https://github.com/software-mansion/react-native-screens/blob/main/guides/GUIDE_FOR_LIBRARY_AUTHORS.md
    • [ ] https://github.com/software-mansion/react-native-screens/blob/main/native-stack/README.md
    • [x] https://github.com/software-mansion/react-native-screens/blob/main/src/types.tsx
    • [ ] https://github.com/software-mansion/react-native-screens/blob/main/src/native-stack/types.tsx
  • [ ] Ensured that CI passes

gtokman avatar Nov 04 '23 12:11 gtokman

Hi @gtokman, thanks for opening this issue! 🥳 Unfortunately our CD is failing on the method onModalDismiss(nil) 😕 Also, I don't know if I understand the onModalDismiss prop correctly - where are we passing the logic of this function to the native code?

tboba avatar Nov 06 '23 10:11 tboba