-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
textNode not passed into .filter method #1867
Closed
jeroentvb opened this issue
May 13, 2021
· 2 comments
· Fixed by #1870 · May be fixed by Omrisnyk/npm-lockfiles#175
Closed
textNode not passed into .filter method #1867
jeroentvb opened this issue
May 13, 2021
· 2 comments
· Fixed by #1870 · May be fixed by Omrisnyk/npm-lockfiles#175
Comments
fb55
added a commit
that referenced
this issue
May 15, 2021
Thanks for reporting! I've opened #1870 with a fix. |
I commented on #1870 as well, but just for visibility: this should also iterate over comment nodes, which that commit still appears not to do. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
.filter(function)
method only gets DOM elements passed in, while.each(function)
gets all DOM nodes, including text nodes. This used to work in RC-5, but doesn't in RC-9. And as far as I could tell, this isn't expected behaviour, because I wasn't able to find info indicating that it is in the jQuery docs.Consider the following html snippet:
If I were to select the body and
.filter
its contents, I won't get theworld
text node in my filter loop. Whereas I will get theworld
text node in my loop if I use.each
on the contents of the body.I've created a repo demonstrating my findings.
Edit: just checked, it also used to work with RC-6. That means it stopped working with the RC-9 release.
The text was updated successfully, but these errors were encountered: