Skip to content

Commit d9d56b7

Browse files
authored
Merge pull request #467 from Adeel-Charolia/patch-2
Typo in "Bubbling and Capturing" Article
2 parents 0fcf9f8 + 6158459 commit d9d56b7

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

2-ui/2-events/02-bubbling-and-capturing/article.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,10 @@ To catch an event on the capturing phase, we need to set the 3rd argument of `ad
140140

141141
Actually, there are two possible values for that optional last argument:
142142

143-
- If it's `false` (default), then the handler is set on the bubbling phrase.
144-
- If it's `true`, then the handler is set on the capturing phrase.
143+
- If it's `false` (default), then the handler is set on the bubbling phase.
144+
- If it's `true`, then the handler is set on the capturing phase.
145145

146-
Note that while formally there are 3 phrases, the 2nd phrase ("target phase": the event reached the element) is not handled separately: handlers on both capturing and bubbling phrases trigger at that phase.
146+
Note that while formally there are 3 phases, the 2nd phase ("target phase": the event reached the element) is not handled separately: handlers on both capturing and bubbling phases trigger at that phase.
147147

148148
Handlers on the target element trigger last on the capturing state, and then trigger first on the bubbling stage.
149149

@@ -175,12 +175,12 @@ The code sets click handlers on *every* element in the document to see which one
175175

176176
If you click on `<td>`, then the sequence is:
177177

178-
1. `HTML` -> `BODY` -> `FORM` -> `DIV` -> `P` (capturing phrase, the first listener), and then:
179-
2. `P` -> `DIV` -> `FORM` -> `BODY` -> `HTML` (bubbling phrase, the second listener).
178+
1. `HTML` -> `BODY` -> `FORM` -> `DIV` -> `P` (capturing phase, the first listener), and then:
179+
2. `P` -> `DIV` -> `FORM` -> `BODY` -> `HTML` (bubbling phase, the second listener).
180180

181181
Please note that `P` shows up two times: at the end of capturing and at the start of bubbling.
182182

183-
There's a property `event.eventPhrase` that tells us the number of the phrase on which the event was caught. But it's rarely used, because we usually know it in the handler.
183+
There's a property `event.eventPhase` that tells us the number of the phase on which the event was caught. But it's rarely used, because we usually know it in the handler.
184184

185185
## Summary
186186

@@ -198,7 +198,7 @@ Each handler can access `event` object properties:
198198

199199
Any event handler can stop the event by calling `event.stopPropagation()`, but that's not recommended, because we can't really be sure we won't need it above, maybe for completely different things.
200200

201-
The capturing phrase is used very rarely, usually we handle events on bubbling. And there's a logic behind that.
201+
The capturing phase is used very rarely, usually we handle events on bubbling. And there's a logic behind that.
202202

203203
In real world, when an accident happens, local authorities react first. They know best the area where it happened. Then higher-level authorities if needed.
204204

0 commit comments

Comments
 (0)