19

Today I've got kind of theoretical question. Why does scroll event not bubble? Is it connected with performance issues? I did some digging, but unfortunately didn't find any answers that would fulfill my curiosity.

Thanks for your replies :)

kaapa
  • 507
  • 4
  • 12

1 Answers1

19

It bubbles but not on elements. It bubbles at the document object up to document.defaultView (window of the document). This behavior happens to avoid performance issues (scroll events can fire at a high rate).

If you want to learn more about scrolling I would suggest reading the W3 documentation:

https://www.w3.org/TR/cssom-view/#scrolling

I hope it helps.

Elvio Cavalcante
  • 476
  • 5
  • 10