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

add .none modifier to keyboard #5976

Closed
barata0 opened this issue Jun 26, 2017 · 8 comments
Closed

add .none modifier to keyboard #5976

barata0 opened this issue Jun 26, 2017 · 8 comments

Comments

@barata0
Copy link

barata0 commented Jun 26, 2017

What problem does this feature solve?

Using the modifiers is greate (.ctrl, .alt, .meta, .shift).
But there is no modifier indicating that ONLY that key was pressed (without ctrl, alt, shift or meta simultaneously.

What does the proposed API look like?

@keydown.space**.none**="myEventWhenEnterIsPressedAlone()"
@keydown.space="myEventWhenEnterIsPressedWithOrWithoutAnyModifier()"

@nickmessing
Copy link
Member

Hmm, that sounds like a good idea but the none naming is not really intuitive, what do you think about .plain?

@nickmessing
Copy link
Member

Tried a POC, works, opened a PR but I think we need to discuss naming anyway.

@posva
Copy link
Member

posva commented Jun 26, 2017

I like plain more as well. I think it's a useful feature 🙂

@blake-newman
Copy link
Member

Also agree simple but very valid use cases

@AimForNaN
Copy link

Ah, I was just about to request the exact same thing for almost the exact same reason! I would like to add that this be extended for mouse clicks, too!

click.left.none
click.none

@nickmessing
Copy link
Member

@TrueFusion, what is expected behaviour for mouse clicks?

nickmessing added a commit to nickmessing/vue that referenced this issue Jun 26, 2017
Add a new event modifier `.plain` to check if event is "plain" (no shift/ctrl/meta/alt key is
pressed)

vuejs#5976
@AimForNaN
Copy link

@nickmessing That any click event with the ".plain" event modifier will trigger if and only if no key modifier is held down. This would leave the default click event available for complex cases and would not conflict with ".left", ".middle" and ".right" when combined.

@nickmessing
Copy link
Member

@TrueFusion, actually the way it's implemented in #5977 already solves that.

ztlevi pushed a commit to ztlevi/vue that referenced this issue Feb 14, 2018
Allow limiting the event to the exact system modifiers specified.
close vuejs#5976
f2009 pushed a commit to f2009/vue that referenced this issue Jan 25, 2019
Allow limiting the event to the exact system modifiers specified.
close vuejs#5976
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants