Temzasse / react-modal-sheet

Flexible bottom sheet component built with Framer Motion to provide buttery smooth UX while keeping accessibility in mind 🪐
https://temzasse.github.io/react-modal-sheet/
MIT License
783 stars 74 forks source link

Is there any way to close the modal when clicking on the overlay #84

Closed willianferreiradev closed 2 years ago

willianferreiradev commented 2 years ago

I need to add this behavior, but I searched and didn't find anything about it. Is there a way to make it work?

Temzasse commented 2 years ago

Hey 👋 This is already possible: https://github.com/Temzasse/react-modal-sheet/blob/master/example/components/SnapPoints.tsx#L50

willianferreiradev commented 2 years ago

Nice. Thanks :)

eurobob commented 3 months ago

I don't know if this is really appropriate?

Maybe i'm not implementing correctly, but when i attempt this, it just closes instantly with no animation.

I feel like using snapPoints is unnecessary, and a simple close method should be exposed to be manually triggered