Docs: Add reminder about e.stopPropagation() (#247)
Per yoshuawuyts/sheet-router#50
This commit is contained in:
committed by
Yoshua Wuyts
parent
eb169495ca
commit
0c5babd300
@@ -555,8 +555,9 @@ html`
|
||||
Example listeners include: `onclick`, `onsubmit`, `oninput`, `onkeydown`,
|
||||
`onkeyup`. A full list can be found [at the yo-yo
|
||||
repo](https://github.com/maxogden/yo-yo/blob/master/update-events.js). When
|
||||
creating listeners always remember to call `e.preventDefault()` on the event so
|
||||
it doesn't bubble up and do stuff like refreshing the full page or the like.
|
||||
creating listeners always remember to call `e.preventDefault()` and
|
||||
`e.stopPropagation()` on the event so it doesn't bubble up and do stuff like
|
||||
refreshing the full page or the like.
|
||||
|
||||
To trigger lifecycle events on any part of a view, set the `onload=${(el) =>
|
||||
{}}` and `onunload=${() => {el}}` attributes. These parameters are useful when
|
||||
|
||||
Reference in New Issue
Block a user