-
Notifications
You must be signed in to change notification settings - Fork 469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Skip intercepting non-left button clicks on links #1908
Conversation
Thanks @derrickreimer! 🙌 |
Nice! I'm a bit surprised to see #1679 and this fix applied to both the Vue and React wrappers. I'm using In fact, native |
Interesting! I am seeing the I'm not really sure if the way click triggering has changed in Vue's internals over time, but at any rate, this fix should cover off Inertia intercepting any aux clicks that may make there way into the |
After some debugging, it turns out the original problem comes down to the
For regular mouse events, However, React events are "synthetic events" and don't provide the
If we revert this PR and update the following line to pass inertia/packages/react/src/Link.ts Line 73 in 3a63529
It's still unclear to me what issue was behind #1679. |
It is also worth mentioning that all of this is still specific to Safari, as you rightfully pointed out in your last comment. A click event, and subsequently |
Ah nice investigative work! Yep, updating the event we pass to |
Oh, good call! I didn't realize I also like your explicit use of |
Fixes #1772 #1329 #1679
All major browsers except Safari trigger the
auxclick
instead ofclick
when the middle button is clicked on a mouse. WebKit has a long-standing bug that does not adhere to this behavior, so Safari dispatches a plain oldclick
event instead. But alas, we can key off of thebutton
property onMouseEvent
to detect if this is an auxiliary click, and skip intercepting in that case.I had to tweak the TypeScript types here to handle receiving a
MouseEvent
and discriminate accordingly.