bvaughn / react-resizable-panels

https://react-resizable-panels.vercel.app/
MIT License
3.58k stars 124 forks source link

More control of hitAreaMargins #334

Closed tommasoturchi closed 2 months ago

tommasoturchi commented 2 months ago

Hi! Thank you for this extremely useful library! One "small" request: would it be possible to have more control over hitAreaMargins? For my use case (a "floating" drag handle over one of the panels), it would be good if I could specify different bottom/top margins for the trigger eventIntersects. Cheers,

Tommaso

bvaughn commented 2 months ago

Thank you! Glad you're finding it useful! :)

Hit area margins are controllable by the hitAreaMargins prop which accepts the same { coarse: number = 15; fine: number = 5; } (coarse is for a touch device, fine is for something that uses an input like a mouse). You can see how they're used here if you're curious: https://github.com/bvaughn/react-resizable-panels/blob/main/packages/react-resizable-panels/src/PanelResizeHandleRegistry.ts#L157-L159

That being said, allowing specific bottom/top margins isn't something I want to try to support. I understand how it could be useful in some edge cases. It's just that realistically, I only have so much time and energy for this project (since it's a hobby project). 🙇🏼 Thanks for understanding.