New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
find() with a :not selector does not have "scoped" behavior #5191
Comments
I think this is intentional. For regular tokens, e.g. classes, appending But I'll add a team discussion label to get this through the team. |
Thank you, so you're saying that |
Not exactly because |
Thanks for your issue. We discussed in the meeting and I think it's okay that |
Description
A
.find()
call like$(x).find(".foo button")
will only find button elements that have a parent with class "foo" somewhere in the DOM subtree under element x. That is the jQuery intention.However, a
.find()
call like$(x).find(":not(.foo button)")
will find all elements that are not a button descending from an element with class "foo". However, that descendant test is not scoped to the subtree under element x. If any element from x up to the root of the DOM has class "foo", buttons will be excluded from the result.This may be intentional or preserved for legacy reasons. I have not personally suffered from this, the bug is mostly to have something to reference.
Link to test case
https://codepen.io/Pointy/pen/OJwWyMb?editors=1111
The text was updated successfully, but these errors were encountered: