Bug Tracker

Opened 12 years ago

Closed 11 years ago

Last modified 9 years ago

#8759 closed bug (duplicate)

.after() breaks on disconnected DOM node with content

Reported by: Jack <[email protected]…> Owned by:
Priority: low Milestone: 1.next
Component: manipulation Version: 1.5.2
Keywords: Cc:
Blocked by: Blocking:


Ok, quick description.

This works as expected (it returns a set of 2 dom nodes):

This does not work (it returns only the first of the 2 dom nodes):

Change History (11)

comment:1 Changed 12 years ago by timmywil

Resolution: duplicate
Status: newclosed

We fixed this issue in closest for 1.6, but there is probably an underlying issue we should take a closer look at. Closing as duplicate.

comment:2 Changed 12 years ago by timmywil

Duplicate of #7369.

comment:3 Changed 12 years ago by Jonas Lundgren

This is still broken in 1.6.1

comment:4 Changed 12 years ago by timmywil

Component: unfiledmanipulation
Priority: undecidedlow
Resolution: duplicate
Status: closedreopened

Thanks. Meant to reopen this one.

comment:5 Changed 12 years ago by timmywil

Status: reopenedopen

comment:7 Changed 12 years ago by john

I think we just need to make sure that the parentNode isn't a document fragment. Confirmed in triage.

comment:8 Changed 11 years ago by antishok

I think #10517 is a dupe of this one, and it was fixed in the latest 1.8b2

comment:9 Changed 11 years ago by dmethvin

Resolution: duplicate
Status: openclosed


comment:10 Changed 11 years ago by dmethvin

Duplicate of #10517.

comment:11 Changed 9 years ago by [email protected]

Strangely, I'm getting the same issue after updating jQuery from 1.8.2 to 1.11.0. The $.after() and $.before() methods aren't working on newly created elements. I need to firstly add the newly created element to DOM, and then insert the new content to it. Dunno if it's a bug, of if these methods were changed.

Anyway, a workaround for this is using $.add() method, but it will work only as a alternative to $.after() method, not $.before().

Note: See TracTickets for help on using tickets.