Does stopPropgation stop the event from propagating in the capture phase?

前端 未结 3 1901
闹比i
闹比i 2021-02-07 06:38

I was looking at http://www.quirksmode.org/js/events_order.html and it is ambiguous in this part:

In the Microsoft model you must set the event’s ca

3条回答
  •  伪装坚强ぢ
    2021-02-07 06:59

    No, an event listener doesn't stop any events from propagating, unless you explicitly tell it to. The part you're referring to deals with the bubble phase specifically. IE's model doesn't support event capturing - full stop. the capture phase is what precedes the bubbling phase:

    Top of the DOM --->event--->traverses--->to--->[target]+[event]-| (capture phase)
          /\                                                       \/
          |------------------------to--------back up-----------------  (bubble up)
    

提交回复
热议问题