Side navigation
#13332 closed bug (fixed)
Opened January 27, 2013 02:04AM UTC
Closed February 13, 2013 02:30AM UTC
Last modified May 24, 2013 01:43PM UTC
.closest("*") yields input even for non-element nodes
Reported by: | gibson042 | Owned by: | |
---|---|---|---|
Priority: | high | Milestone: | 1.10/2.0 |
Component: | traversing | Version: | 1.9.0 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Ref. #13265.
.closest
passes text/comment/etc. nodes directly to Sizzle, which assumes all input to be elements, so .closest("*")
is erroneously an identity mapping.
Attachments (0)
Change History (6)
Changed February 12, 2013 04:02AM UTC by comment:1
Changed February 12, 2013 05:08AM UTC by comment:2
Indeed. This is paired with #13265 in my mind, and they should either fix or wontfix together. A fix looks like https://github.com/jquery/jquery/pull/1146.
Changed February 13, 2013 02:30AM UTC by comment:3
Changed February 13, 2013 02:38AM UTC by comment:4
component: | unfiled → traversing |
---|---|
milestone: | None → 1.9.2 |
priority: | undecided → high |
Changed February 13, 2013 03:09AM UTC by comment:5
Changed May 24, 2013 01:43PM UTC by comment:6
milestone: | 1.9.2 → 1.10/2.0 |
---|
Bulk update to milestone 1.10/2.0
Seems like it can easily be fixed, but I suspect it hasn't been reported because it's really rare to get into that situation. For events we make sure the event target is an element, and it would seem really rare for anyone to use
.contents()
or serialize HTML with top-level text nodes or and then use.closest()
.