Skip to content

Commit

Permalink
Docs: Add reminder about e.stopPropagation() (#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
timwis authored and yoshuawuyts committed Sep 5, 2016
1 parent eb16949 commit 0c5babd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0c5babd

Please sign in to comment.