Skip to main content

Bug Tracker

Side navigation

#13019 closed bug (fixed)

Opened December 08, 2012 07:28PM UTC

Closed December 09, 2012 07:12PM UTC

Last modified December 09, 2012 07:47PM UTC

New pre-1.9 .replaceWith() behavior leaks data and events

Reported by: dmethvin Owned by: dmethvin
Priority: high Milestone: 1.9
Component: manipulation Version: git
Keywords: Cc:
Blocked by: Blocking:

The changes to 1.9 .replaceWith() that update the set for a disconnected element can leak jQuery data and events because the element is updated in the set without calling .remove() on the element in the set.

Upon reflection, I think it's a mistake to attempt to update the set anyway, since we always .pushStack() in those cases. So I think we should do the same as .before() or .after() and simply ignore disconnected elements.

Attachments (0)
Change History (4)

Changed December 08, 2012 07:28PM UTC by dmethvin comment:1

component: unfiledmanipulation
milestone: None1.9
owner: → dmethvin
priority: undecidedhigh
status: newassigned
version: 1.8.3git

Changed December 08, 2012 07:38PM UTC by dmethvin comment:2

ref #11338

Changed December 09, 2012 07:12PM UTC by Dave Methvin comment:3

resolution: → fixed
status: assignedclosed

Fix #13019. Disconnected nodes with .replaceWith are a noop. Close gh-1062.

Changeset: f8f52cfcf4ff5d0e3e50a73b03aff0fd9c72105b

Changed December 09, 2012 07:47PM UTC by Dave Methvin comment:4

Ref #13019 and gh-1062. Use parentNode check instead of isDisconnected().

Changeset: 2eda329be6ac2f68e9b313ee607ea24165c68755