closeOnOutsidePointer for the Resizable Panel #48
-
Hey there - thanks so much for this library it is really well made! I had an idea that the Resizable Panel could act like the Twitter/X mobile app left side menu, i.e. when you click your avatar in top left, the left panel expands, and when you click outside of it or swipe left, it collapses to 0. I know this might be better for the drawer/dialog on mobile, since it has the Just wanted some insight - should I just use a drawer or is this a reasonable implementation for Resizable? Thanks for any input! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey! Implementing this in the Resizable primitive would require a lot of additional code and tinkering, and it's not the goal of the resizable to be a dismissible layer like this. |
Beta Was this translation helpful? Give feedback.
Hey!
This really sounds like something for the drawer. Twitter's app panel is 1/1 implementable with the drawer primitive I think. The corvu docs use the drawer for the mobile navigation and it's pretty much the same :D
Implementing this in the Resizable primitive would require a lot of additional code and tinkering, and it's not the goal of the resizable to be a dismissible layer like this.
The Resizable already has collapsible logic, you could try implementing a "close on outside pointer" event listener yourself and call
.collapse()
on the context/children callback.I hope this answers your question! And thanks for the compliment, really motivates to keep going 😊