Skip to content
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

@click.middle/right not working #7020

Closed
zajca opened this issue Nov 8, 2017 · 2 comments
Closed

@click.middle/right not working #7020

zajca opened this issue Nov 8, 2017 · 2 comments

Comments

@zajca
Copy link

zajca commented Nov 8, 2017

Version

2.5.3

Reproduction link

https://jsfiddle.net/6jy8v5g6/

Steps to reproduce

click using middel button on text in fiddle with @click.middle

What is expected?

call function used in @click.middle

What is actually happening?

nothing


according to docs: https://vuejs.org/v2/guide/events.html#Mouse-Button-Modifiers
in 2.5 they don't work

@psimyn
Copy link

psimyn commented Nov 9, 2017

According to awamwang@e8e2913 you should use contextmenu instead. Docs should probably be updated

See #5330

@yyx990803
Copy link
Member

These modifiers do not work for click because the click event does not actually fire for right clicks and middle clicks. Instead, contextmenu and auxclick are fired respectively.

This can be confusing so I've implemented a normalization in the compiler that transforms click.right and click.middle to the respective equivalents. Unfortunately, auxclick is not supported universally, so we have to use mouseup instead, this is not perfect since it would fire even if the click did not start on the element, but it's close enough and a dragged-middle-click seems an extremely rare operation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants