stanleyugwu / react-native-bottom-sheet

The tiny 📦, smart 😎, and flexible 🎗 bottom sheet your app craves
https://github.com/stanleyugwu/react-native-bottom-sheet#readme
MIT License
255 stars 9 forks source link

Prevent closing #19

Closed pranavbabu closed 6 months ago

pranavbabu commented 6 months ago

Hey, first of all, this is great library and good job! I wonder if it's possible to prevent bottom sheet from closing, lets say to show some warning for user in some cases.

stanleyugwu commented 6 months ago

Hey @pranavbabu I'm glad this package is useful to you.

And yes! you can disable closing by just setting closeOnDragDown prop to false

E.g

<BottomSheet ref={sheetRef} closeOnDragDown={false}>
...
</BottomSheet>
pranavbabu commented 5 months ago

I meant callback 'beforeClose' , so I can add for exmaple extra warning if users closing bottom sheet and prevent it with e.preventDefault() maybe

stanleyugwu commented 4 months ago

There's onClose callback