Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Event propagation upwards or downwards

When a button on the screen is clicked, how does the event unfold? Does it begin with the button which has the option of passing the event to its parent?

Or does the parent receive the event first and pass it on to its children until it reaches the button?

like image 473
14 revs, 12 users 16% Avatar asked Feb 03 '26 18:02

14 revs, 12 users 16%


1 Answers

There are 2 models for event propagation:

  • Event capturing: Downward
  • Event bubbling: Upward

Refer here

like image 61
An Phung Avatar answered Feb 05 '26 07:02

An Phung