Opened 10 years ago
Closed 10 years ago
#12337 closed bug (fixed)
:nth-child selector not accurate after new child element added
Reported by: | Owned by: | gibson042 | |
---|---|---|---|
Priority: | high | Milestone: | 1.8.2 |
Component: | selector | Version: | 1.8.0 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Using the :nth-child selector after a new child element has been added to a parent isn't working correctly in 1.8.0. However, with 1.7.2 the same scenario works as expected.
A test for using .find vs .children was added as well because in 1.7.2 using .children('.class:nth-child(NUMBER)') was significantly faster in Internet Explorer.
It seems the .find vs .children is also being handled differently. Using 1.8.0 the .find variant works in Chrome 21.0.1180.79 but .children remains incorrect.
I've only ran this against Internet Explorer 8 and Chrome 21.0.1180.79. Thanks for your time!
jsFiddle: http://jsfiddle.net/yVe4H/1/
Change History (6)
comment:1 Changed 10 years ago by
Component: | unfiled → traversing |
---|---|
Milestone: | None → 1.8.1 |
Priority: | undecided → blocker |
Status: | new → open |
comment:2 Changed 10 years ago by
Component: | traversing → selector |
---|---|
Resolution: | → duplicate |
Status: | open → closed |
Duplicate of #12205.
comment:3 Changed 10 years ago by
Milestone: | 1.8.1 → 1.8.2 |
---|---|
Priority: | blocker → high |
Resolution: | duplicate |
Status: | closed → reopened |
comment:4 Changed 10 years ago by
Owner: | set to gibson042 |
---|---|
Status: | reopened → assigned |
comment:6 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Update Sizzle: fix position caching with child selectors. Fixes #12337.
Changeset: 99f4825707e2bf6f19598a00f53d58ef3878190c
Confirmed. Here's an updated fiddle: http://jsfiddle.net/dmethvin/yVe4H/2/