Closed Fabioni closed 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.
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
😃
If you'd like to remove that feature, I suggest just forking this library. The license is very permissive so as to allow that.
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.
For reference, here a screen recording:
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?
No. This is not a change I'm interested in making.
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.
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-L174I propose we have an option to completely disable the behavior, getting back the old straight-forward behaviour.
My problems with
hitAreaMargins
:hitAreaMargins={{ coarse: 0, fine: 0}}
still uses the tricky calculations you do in your code which is totally unnecessary and can lead to bugs. Reporting the bugs is one thing, but being able to disableable it would help a lot.collapsible
, which I can not reproduce in codesandbox but I suspect it has to do with the wayhitAreaMargins
works.