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

mouse modifier @click.right not working #5330

Closed
stefanonepa opened this issue Mar 30, 2017 · 11 comments
Closed

mouse modifier @click.right not working #5330

stefanonepa opened this issue Mar 30, 2017 · 11 comments
Labels

Comments

@stefanonepa
Copy link

Version

2.2.1

Reproduction link

https://jsfiddle.net/nosferatu79/z1jhpewo/

Steps to reproduce

click on the textarea with the right click of your mouse

What is expected?

it should add in the textarea the following text:

contextmenu
right

What is actually happening?

there is only the text:

contextmenu

@Kingwl
Copy link
Member

Kingwl commented Mar 30, 2017

looks fixed
3294eba

@stefanonepa
Copy link
Author

Sorry, I'll try with a version >2.2.1,

Thank you

@stefanonepa
Copy link
Author

sorry, but in this updated version it doesn't work either:
https://jsfiddle.net/z1jhpewo/1/

@stefanonepa stefanonepa reopened this Mar 30, 2017
@Kingwl
Copy link
Member

Kingwl commented Mar 30, 2017

@stefanonepa
sorry it's my fault

@Kingwl
Copy link
Member

Kingwl commented Mar 30, 2017

@stefanonepa
maybe u need mousedown event
https://javascript.info/mouse-events-basics

@stefanonepa
Copy link
Author

@Kingwl I'm not sure that this documentation is very reliable, because in the explanation here: https://javascript.info/mouse-events-basics#complex-events , it says that contextmenu is fired on mousedown (and in the example it didn't write contextmenu if you just mousdown the right button)...

In the other way it says that a click event is fired when mousedown is followed by by a mouseup... So it seems that

@click.right

should works, you do not agree?

@Kingwl
Copy link
Member

Kingwl commented Mar 30, 2017

@stefanonepa
https://www.w3.org/TR/uievents/#event-type-click

The click event should only be fired for the primary pointer button (i.e., when button value is 0, buttons value is 1). Secondary buttons (like the middle or right button on a standard mouse) MUST NOT fire click events. The click event MAY be preceded by the mousedown and mouseup events on the same element, disregarding changes between other node types (e.g., text nodes). Depending upon the environment configuration, the click event MAY be dispatched if one or more of the event types mouseover, mousemove, and mouseout occur between the press and release of the pointing device button. The click event MAY also be followed by the dblclick event.

@stefanonepa
Copy link
Author

@Kingwl thank you for the standard (even it's a bit foggy for me)

But how should I interpret or use the .right of the "mouse button modifiers" (cf. https://vuejs.org/v2/guide/events.html#Mouse-Button-Modifiers)? Because with the @click.middle it fire a click event... Maybe I should suggest to add some info in the official documentation?

@yyx990803
Copy link
Member

Hmm maybe click.right should be aliased into contextmenu at compile time?

@stefanonepa
Copy link
Author

It would be a great!

@stefanonepa
Copy link
Author

Thank you @yyx990803 !

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

No branches or pull requests

3 participants