emilkowalski / vaul

An unstyled drawer component for React.
https://vaul.emilkowal.ski
MIT License
5.29k stars 170 forks source link

Controlled state of snap points not working properly #239

Closed BjoernRave closed 5 months ago

BjoernRave commented 5 months ago

I want to trigger the change of the snap point programmatically, but currently its not working as expected. I need to press the button twice for it to work.

I forked the codesandbox with snap points to show the problem.

https://codesandbox.io/p/devbox/drawer-snap-points-forked-dts7ct

backuardo commented 5 months ago

I'm noticing the same thing.

If I log the snap value in a useEffect I see the value change, but the component doesn't react to the state change.

emilkowalski commented 5 months ago

Fixed in #248