-
-
Notifications
You must be signed in to change notification settings - Fork 462
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
[2.0] Prefetch click triggers visit on secondary button mouseup #2185
Comments
I'm unable to replicate this in |
Hi Joe Have upgraded to v2.0.2 and have the same issue. Have noticed in the process of trying to debug, you get the same result when clicking a Link with "select component on page" in Chrome Vue devtools. I'll try and reproduce in a clean repo and circle back with it if I still get the same. Cheers Chris |
Have reproduced on the navbar of the welcome page on a fresh install of Breeze (with the nav bar Links changed to prefetch="click"). I've tested on Chrome and Edge, both on Windows. Don't have access to a Mac to check. Cheers Chris |
Ok, well, I was unable to replicate it on any scenario on a Mac, I even wrote a Playwright test to safeguard against this behavior and it passed. But. I got access to a Windows machine and was able to replicate the behavior it seems. So might take a minute to diagnose what is going on, but at least now I know how to replicate. |
Huh! How bizarre. Thanks for looking into Joe. |
Version:
@inertiajs/vue3
version: 2.0.0Describe the problem:
When using prefetch="click", the visit is triggered on mouse up of the secondary mouse button (e.g. user is attempting to access context menu) - making it impossible to e.g. open in new tab without triggering a visit in the current window.
I cannot think of a scenario where the intent behind a secondary button press would be a visit in the same window (i.e. will always be new tab, new window, etc.), so we could probably just ignore any MouseEvent where MouseEvent.button === 2 (or possibly where MouseEvent.button !== 0).
I have only tested w/ Vue3, but it looks like this behavior is common to all adapters.
Steps to reproduce:
<Link href="/" prefetch="click">I shouldn't be visited when clicked with secondary</Link>
The text was updated successfully, but these errors were encountered: