DEV Community

Discussion on: Make your virtualized list

Collapse
 
andrewmat profile image
André Matulionis

What is the third argument false in the addEventListener function?

window.addEventListener('scroll', isInViewportListener, false);
Collapse
 
jeduardo824 profile image
Eduardo Alencar

I think it is the useCapture parameter. It is a Boolean indicating whether events of this type will be dispatched to the registered listener before being dispatched to any EventTarget beneath it in the DOM tree. Events that are bubbling upward through the tree will not trigger a listener designated to use capture.

developer.mozilla.org/en-US/docs/W...
w3.org/TR/DOM-Level-3-Events/#even...