#12664 closed bug (fixed)
.after()
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | high | Milestone: | None |
Component: | manipulation | Version: | 1.8.0 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
jQuery 1.8.0, 1.8.1 and 1.8.2: $collection.after($elem) adds $elem to $collection jQuery set.
Change History (8)
comment:1 follow-up: 2 Changed 10 years ago by
Owner: | set to [email protected]… |
---|---|
Status: | new → pending |
comment:2 Changed 10 years ago by
Replying to dmethvin:
Can you provide a test case on jsfiddle.net?
Hi. jsfiddle.net test case link: http://jsfiddle.net/msh6180339/5jkHm/
Thanks a lot.
comment:3 Changed 10 years ago by
Component: | unfiled → manipulation |
---|---|
Keywords: | 1.9-discuss added |
Priority: | undecided → high |
Status: | pending → open |
What should .after() and .before() do to the current set vs. the pushStack set?
comment:4 Changed 10 years ago by
As we discussed, the problem is that .after(content)
was intended to have two different behaviors:
- If the first element in the jQuery set is connected to a document, the
content
is placed after each element in the set, and the original set is returned.
- If the first element in the jQuery set is disconnected, the
content
is added to the end of a new (pushStack()
ed) set, and that is returned.
We've had this broken in different ways in different versions. I think we should remove the second behavior and always treat elements the same way.
comment:6 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | open → closed |
Refactored before/after/replaceWith to not pushStack. Fixes #12664, closes gh-987
Changeset: 0c1cea376196d24acc73c64dbdff1880a2dfd006
comment:7 Changed 10 years ago by
I think this refactoring makes before/after/replaceWith more obvious and cause them to work more naturally.
Thank you all.
comment:8 Changed 10 years ago by
Keywords: | 1.9-discuss removed |
---|
Can you provide a test case on jsfiddle.net?