xh / hoist-react

🏗️ ⚛️ The XH Hoist toolkit for React
https://xh.io
Apache License 2.0
24 stars 9 forks source link

Panel dragger workaround for Safari #3799

Closed TomTirapani closed 1 month ago

TomTirapani commented 1 month ago

Safari is not setting buttons or button to 1 on Drag events, which is causing our Panel resizing to early out. See: https://github.com/xh/hoist-react/issues/3797

This workaround adds a fallback check to the deprecated MouseEvent.which property, which is being set: https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/which#value_for_mouseevent_non-standard

As a deprecated API we obviously should not rely on it, but I think its safe to use as fall back for this specific issue in lieu of a better solution.

Hoist P/R Checklist

Pull request authors: Review and check off the below. Items that do not apply can also be checked off to indicate they have been considered. If unclear if a step is relevant, please leave unchecked and note in comments.

If your change is still a WIP, please use the "Create draft pull request" option in the split button below to indicate it is not ready yet for a final review.

Pull request reviewers: when merging this P/R, please consider using a squash commit to collapse multiple intermediate commits into a single commit representing the overall feature change. This helps keep the commit log clean and easy to scan across releases. PRs containing a single commit should be rebased when possible.

lbwexler commented 1 month ago

Thanks for the quick turnaround here Tom. I think this is very pragmatic.