Skip to content

Strange error behavior of event delegation when customizing jQuery #5379

Description

@ajiho

Description

My build script is as follows:

npm run build -- --esm --include=event --include=traversing

When I use event delegation

html

<button data-test1="test1" data-test2="test2">test</button>
$(document).on('click', '[data-test1][data-test2]', function () {
    //error: Uncaught TypeError: jQuery.attr is not a function
});

According to the description of readme.md,selector: The full jQuery selector engine. When this module is excluded, it is replaced with a rudimentary selector engine based on the browser's querySelectorAll,However, querySelectorAll supports this type of selector
I would like to ask if this design is intentional or is it a flaw?

By the way, I have already tested it in the full version and there is no such issue

Thank you.

Link to test case

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions