daliborgogic / nuxt-interpolation

Nuxt.js module as directive for binding every link to catch the click event, and if it's a relative link router will push.
https://www.npmjs.com/package/nuxt-interpolation
44 stars 2 forks source link

Default behaviour is lost when using ctrl/cmd-click to open page in a new tab #18

Closed jonathanmeurrens closed 3 years ago

jonathanmeurrens commented 3 years ago

First of all, thank you for the helpful plugin. I'm opening this ticket for a bug we encountered during testing: Relative links that get transformed with v-interpolation lose their default behaviour when using ctrl/cmd-click to open the page in a new tab. That's an expected user-pattern that's getting lost when using the plugin. It would be nice to keep that default behaviour. Adding a check for event.metaKey when the click occurred could be a solution to fix this issue? (push & preventDefault would not be triggered when cmd or ctrl is used while clicking the link)

daliborgogic commented 3 years ago

Fixed 9bf855de5678ef7f4689ff2703233be0f1e6b5d4