'Capture Option vs useCapture
The docs for addEventListener/removeEventListener
both have a capture
option and a useCapture
parameter.
On its face these seem to do the exact same thing. Could someone elaborate if there are any differences or preferred? Should I use both if I want event listeners added/removed in the capture phase?
Solution 1:[1]
It's exactly the same, here you can find details.
For historical reasons, options can also be false/true, that’s the same as {capture: false/true}.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | granik96 |