mirror of
https://github.com/sveltejs/svelte.git
synced 2024-12-01 17:30:59 +01:00
link directly to event modifier tutorial
This commit is contained in:
parent
9a0a2e2a52
commit
729fc4e891
@ -9,8 +9,5 @@ On line 33, add the `keydown` listener:
|
||||
```html
|
||||
<svelte:window on:keydown={handleKeydown}/>
|
||||
```
|
||||
Don't forget to add `preventDefault` modifier if you want to press any other key, e.g. after you have pressed `Tab` or `Ctrl + D`:
|
||||
|
||||
```html
|
||||
<svelte:window on:keydown|preventDefault={handleKeydown}/>
|
||||
```
|
||||
> As with DOM elements, you can add [event modifiers](tutorial/event-modifiers) like `preventDefault`.
|
||||
|
Loading…
Reference in New Issue
Block a user