bvaughn / react-resizable-panels

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

Option to completely deactivate hitAreaMargins #341

Closed Fabioni closed 2 months ago

Fabioni commented 2 months ago

The whole hitAreaMargins is quite tricky and compote heavy as you state yourself in: https://github.com/bvaughn/react-resizable-panels/blob/638d0f6d3a9d1aeabae8333396ed725ecbeff513/packages/react-resizable-panels/src/PanelResizeHandleRegistry.ts#L169-L174

I propose we have an option to completely disable the behavior, getting back the old straight-forward behaviour.

My problems with hitAreaMargins:

bvaughn commented 2 months ago

What you're describing sounds like it's pretty specific to your website. If you can provide a Code Sandbox example, I'll take a look and see if I can recommend something to help. (Or if there is a bug in this library, that's also good to uncover.)

Generally speaking, I don't want to support two separate mechanisms for resize handling based on hitAreaMargins though, so this is not a change I'm interested in making.

Fabioni commented 2 months ago

This problem was related to https://github.com/bvaughn/react-resizable-panels/issues/342, so I am fine for the moment.

I still think we should have the option to disable the "TRICKY" functionality from hitAreaMargins 😃

bvaughn commented 2 months ago

If you'd like to remove that feature, I suggest just forking this library. The license is very permissive so as to allow that.

Fabioni commented 2 months ago

One of my problems ("clicking panning in the margin area triggers movement of the panel but also of a element behind it") should have actually been solved by https://github.com/bvaughn/react-resizable-panels/pull/338, correct?

I still have it and will try to create a sandbox. Maybe this is related to how google maps api is also kind of greedy for panning events.

Fabioni commented 2 months ago

For reference, here a screen recording:

https://github.com/bvaughn/react-resizable-panels/assets/45362676/5f6d9679-3c67-49ae-8f15-1b14e5e461cd

Fabioni commented 2 months ago

If you'd like to remove that feature, I suggest just forking this library. The license is very permissive so as to allow that.

Would you allow a PR?

bvaughn commented 2 months ago

No. This is not a change I'm interested in making.

bvaughn commented 2 months ago

It's possible Google maps is also listening at the root of the window and intercepting the events before this library is. I don't know.