From 434ea3aaa6ede988bcd42f962b154388c869b8e8 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Fri, 17 Feb 2017 11:52:06 +0100 Subject: [PATCH 1/2] Add note about keyup for modifier keys Related to vuejs/vue#4955 --- src/v2/guide/events.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/v2/guide/events.md b/src/v2/guide/events.md index d39d967bd9..eb3e9d7889 100644 --- a/src/v2/guide/events.md +++ b/src/v2/guide/events.md @@ -261,6 +261,8 @@ For example:
Do something
``` +

Note that modifier keys are different from regular keys and when used with `keyup` events, they have to be pressed when the event is emitted. In other words, `keyup.ctrl` will only trigger if you release a key while holding `ctrl` pressed. It won't trigger if you release the `ctrl` key alone.

+ ## Why Listeners in HTML? You might be concerned that this whole event listening approach violates the good old rules about "separation of concerns". Rest assured - since all Vue handler functions and expressions are strictly bound to the ViewModel that's handling the current view, it won't cause any maintenance difficulty. In fact, there are several benefits in using `v-on`: From 8992fab76fc9e1a094e44ea016b1f93116134a01 Mon Sep 17 00:00:00 2001 From: Chris Fritz Date: Fri, 17 Feb 2017 13:38:27 -0500 Subject: [PATCH 2/2] Slight change in phrasing to modifier key warning --- src/v2/guide/events.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/v2/guide/events.md b/src/v2/guide/events.md index eb3e9d7889..b86d005c24 100644 --- a/src/v2/guide/events.md +++ b/src/v2/guide/events.md @@ -261,7 +261,7 @@ For example:
Do something
``` -

Note that modifier keys are different from regular keys and when used with `keyup` events, they have to be pressed when the event is emitted. In other words, `keyup.ctrl` will only trigger if you release a key while holding `ctrl` pressed. It won't trigger if you release the `ctrl` key alone.

+

Note that modifier keys are different from regular keys and when used with `keyup` events, they have to be pressed when the event is emitted. In other words, `keyup.ctrl` will only trigger if you release a key while holding down `ctrl`. It won't trigger if you release the `ctrl` key alone.

## Why Listeners in HTML?