🌐 AI搜索 & 代理 主页
Skip to content

jQuery does not stop propagation of jQuery.click() on native event-handlers #3693

@caillou

Description

@caillou

Description

Event-handlers that are registered natively are called even if event.stopPropagation() is called when jQuery.click() is used.

Using the native HTMLelement.click() correctly stops propagation.

Link to test case

I the following test case, both, a HTMLelement.click() and a jQuery.click() are triggered when the page is loaded.

In both cases, the event bubbling is prevented. The jQuery.click() is still triggered on the document event-handler.

https://jsbin.com/qekuda/7/edit?html,js,output

Link to Stackoverflow discussion

https://stackoverflow.com/questions/44309897/jquery-does-not-stop-propagation-of-jquery-click-on-native-event-handlers

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions