react-spring-bottom-sheet icon indicating copy to clipboard operation
react-spring-bottom-sheet copied to clipboard

Question - Dynamic Blocking Prop

Open lilbumblebear opened this issue 4 years ago • 2 comments

Hi, I want to change the blocking prop based on whether the bottom sheet is showing only the header or not. Essentially, I consider the bottom sheet "open" if more than just the header is shown and "closed" if only the header is shown. When the bottom sheet is "open" in my case, I want it blocking the background, but I don't want it blocking when it is "closed".

If I use the onSpringEnd event, the blocking change is very delayed.

If I use a combination of onSpringStart, onSpringCancel and onSpringEnd, I get a very janky blocking transition.

Demo Code

**try barely dragging the header to get the weird effects.

What is the better way to accomplish this?

The bottom sheet works perfectly like I expect, if there is no header and open prop is toggled.

lilbumblebear avatar Aug 03 '21 14:08 lilbumblebear

To extend this, I would also like a dynamic blocking prop - would be great if it could be tied to an ID. My use case is that I have a cookies message, and would like for the cookies message to be clickable. The z-index of the cookies is higher than that of the sheet, so it appears over the sheet, but the blocking makes it impossible to interact with it

usahai avatar Oct 11 '21 04:10 usahai

It's very difficult to do that with the current api. But in the next major you'll be able to subscribe to the snap position in real-time, and the current state (if it's being dragged, opening or closing) in order to build things like this.

stipsan avatar Oct 20 '21 12:10 stipsan