

Hasty Treat - Things You Should Know About Javascript Events
source link: https://syntax.fm/show/245/hasty-treat-things-you-should-know-about-javascript-events
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

May 4th, 2020
Hasty Treat - Things You Should Know About Javascript Events
👇 Download Show✏️ Edit Show NotesIn this Hasty Treat, Scott and Wes talk about javascript events, and how to avoid some common pitfalls!
Prismic - Sponsor
Prismic is a Headless CMS that makes it easy to build website pages as a set of components. Break pages into sections of components using React, Vue, or whatever you like. Make corresponding Slices in Prismic. Start building pages dynamically in minutes. Get started at prismic.io/syntax.
Show Notes
02:23 - Event bubbling
- Some events bubble, some don't
- Clicks bubble
- Mouseevents bubble
- Focus doesn't bubble
04:10 - Event capturing
- Capture: down, bubble up
- Canceling: prevent default
- target` vs currentTarget
- currentTarget is what got clicked
- target is what you listened for the click on
- event.isTrusted
- addEventListener once: true
Links
Tweet us your tasty treats!
Recommend
-
12
✏️ Edit Show NotesIn this Hasty Treat, Scott and Wes talk about all things color in CSS, both current and coming soon! Sentry - Sponsor ...
-
7
Dec 7th, 2020Hasty Treat - Why should I use React Hooks?👇 Download Show✏️ Edit...
-
5
Feb 3rd, 2020Hasty Treat - Non-Glamorous Skills You Should Have👇 Download Show✏️ Edit...
-
16
Dec 31st, 2018Hasty Treat - CSS and JS Pointer Events👇 Download Show✏️ Edi...
-
11
Aug 2nd, 2021Hasty Treat - Git the Latest - New Things In Tech - CoPilot, Petite Vue, Stackblitz, Web3 + More!👇 Download Show
-
8
Jun 22nd, 2020Hasty Treat - Some Neat CSS Functions That You Should Know About👇 Download Show
-
7
Apr 20th, 2020Hasty Treat - 5 More Things That Make Your Site Slow👇 Download Show
-
9
Apr 13th, 2020Hasty Treat - 5 Things That Make Your Site Slow👇 Download Show✏️ Edi...
-
9
Feb 8th, 2021Hasty Treat - Keyboard Events Are Surprisingly Interesting👇 Download Show
-
9
May 25th, 2020Hasty Treat - Should You Support IE11?👇 Download Show✏️ Edit Show Notes
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK