Skip to content

Commit 3f15d16

Browse files
posvachrisvfritz
authored andcommitted
Add note about keyup for modifier keys (#765)
* Add note about keyup for modifier keys Related to vuejs/vue#4955 * Slight change in phrasing to modifier key warning
1 parent d4a5a1b commit 3f15d16

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/v2/guide/events.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,8 @@ For example:
261261
<div @click.ctrl="doSomething">Do something</div>
262262
```
263263

264+
<p class="tip">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.</p>
265+
264266
## Why Listeners in HTML?
265267

266268
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`:

0 commit comments

Comments
 (0)