-
-
Notifications
You must be signed in to change notification settings - Fork 406
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
Middle mouse button click does not open link in new tab when using Safari #1772
Comments
Interestingly, this seems to be isolated to the React wrapper (which, as you referenced, inertiajs.com is built on) and doesn't affect Vue. The Ping CRM demo app uses the Vue adapter and works as expected in Safari. Comparing the Vue and React link components doesn't yield anything obvious. Wondering if it has something to do with some underlying React thing. |
I'm attempting to reproduce -- do you happen to have OS/browser versions where you observed this behavior? |
Hey @derrickreimer, I just repro-ed this issue in Safari on inertiajs.com using my MX Master's middle button. Chrome and Firefox work as expected.
|
Pardon my ignorance 😅 is "middle click" a different action than Command+Click (on macOS)? |
Yes! Command + Click (macOS) = Ctrl + Click (Windows) which is simply a modifier key + a normal click. Middle click is an entirely separate event. Looks like in JavaScript this is considered an
https://developer.mozilla.org/en-US/docs/Web/API/Element/auxclick_event#preventing_default_actions |
Interestingly, it looks like there's no way to trigger middle clicks on macOS with the default trackpad or Magic Mouse, but apart from finding a mouse with a middle click button (triggered by pressing down on the scroll wheel), there are utilities that allow you to simulate. https://github.com/artginzburg/MiddleClick-Sonoma Oh, the edge cases! |
Very interesting! It looks like there's a long standing WebKit bug that causes |
Closing this one since it's not actionable on our part. If Safari fixes the bug, this one should heal itself. |
Reported in 2008, oof. Were you able to figure out why middle click with the Vue.js wrapper (http://demo.inertiajs.com) works in Safari? |
Ohh I may have spoken too soon! It appears there's a |
You're on to something! |
Version:
@inertiajs/react
version: 1.0.14Describe the problem:
Clicking an InertiaLink with the middle mouse button opens the page in the same tab.
I would expect it to behave like a normal a link, which opens the page in a new tab when using the middle mouse button.
Steps to reproduce:
Open https://inertiajs.com in Safari and click on a link using the middle mouse button. Result: It opens in the current tab, not a new tab.
Open https://inertiajs.com in Chrome and click on a link using the middle mouse button. Result: It opens in a new tab.
The text was updated successfully, but these errors were encountered: