RyoSogawa / react-resizable-layout

Headless React component and hook for resizable layout.
https://www.npmjs.com/package/react-resizable-layout
MIT License
86 stars 14 forks source link

clamp the current position to the min/max #25

Closed ryandvmartin closed 11 months ago

ryandvmartin commented 11 months ago

When dragging quickly, the position might go beyond the min/max before the animation catches up. In this case the handlePointerMove callback will ignore updating the position, but incase a min/max is defined it should be set to the min or max as appropriate so the drag handle is guaranteed to hit the min/max position.

I propose the following changes that are working for my test case, but welcome any suggestions.

Thanks for the excellent package!

vercel[bot] commented 11 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-resizable-layout ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 20, 2023 2:50pm