Docs: Add reminder about e.stopPropagation() (#247)

Per yoshuawuyts/sheet-router#50
This commit is contained in:
Tim Wisniewski
2016-09-05 16:12:32 +02:00
committed by Yoshua Wuyts
parent eb169495ca
commit 0c5babd300
+3 -2
View File
@@ -555,8 +555,9 @@ html`
Example listeners include: `onclick`, `onsubmit`, `oninput`, `onkeydown`, Example listeners include: `onclick`, `onsubmit`, `oninput`, `onkeydown`,
`onkeyup`. A full list can be found [at the yo-yo `onkeyup`. A full list can be found [at the yo-yo
repo](https://github.com/maxogden/yo-yo/blob/master/update-events.js). When 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 creating listeners always remember to call `e.preventDefault()` and
it doesn't bubble up and do stuff like refreshing the full page or the like. `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) => To trigger lifecycle events on any part of a view, set the `onload=${(el) =>
{}}` and `onunload=${() => {el}}` attributes. These parameters are useful when {}}` and `onunload=${() => {el}}` attributes. These parameters are useful when