From 48bd3f5f376223855a45ccc5d10766648d199e7a Mon Sep 17 00:00:00 2001 From: Silas Date: Sat, 15 Mar 2025 04:43:48 -0300 Subject: [PATCH 1/5] Inicio da traducao do artigo bubbling and capturing --- .../02-bubbling-and-capturing/article.md | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/2-ui/2-events/02-bubbling-and-capturing/article.md b/2-ui/2-events/02-bubbling-and-capturing/article.md index 2448cfa5b..417d31326 100644 --- a/2-ui/2-events/02-bubbling-and-capturing/article.md +++ b/2-ui/2-events/02-bubbling-and-capturing/article.md @@ -1,24 +1,24 @@ # Bubbling and capturing -Let's start with an example. +Vamos começar com um exemplo. -This handler is assigned to `
`, but also runs if you click any nested tag like `` or ``: +Este manipulador de eventos foi atribuído a `
`, mas também é acionado caso você clique em qualquer elemento aninhado como `` ou ``: ```html autorun height=60
- If you click on EM, the handler on DIV runs. + Se você clicar noEM, o manipulador na DIV será acionado.
``` -Isn't it a bit strange? Why does the handler on `
` run if the actual click was on ``? +Não é um pouco estranho? Por que o manipulador na `
` é acionado se o clique foi no ``? ## Bubbling -The bubbling principle is simple. +O bubbling é simples -**When an event happens on an element, it first runs the handlers on it, then on its parent, then all the way up on other ancestors.** +**Quando um evento acontece em um elemento, ele primeiro executa os manipuladores nesse elemento, depois em seu elemento pai, e em seguida, sobe pelos outros ancestrais.** -Let's say we have 3 nested elements `FORM > DIV > P` with a handler on each of them: +Vamos supor que tenhamos 3 elementos aninhados `FORM > DIV > P` com um manipulador em cada um: ```html run autorun