#13019 closed bug (fixed)
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: |
Description
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.
Change History (4)
comment:1 Changed 10 years ago by
| Component: | unfiled → manipulation |
|---|---|
| Milestone: | None → 1.9 |
| Owner: | set to dmethvin |
| Priority: | undecided → high |
| Status: | new → assigned |
| Version: | 1.8.3 → git |
comment:2 Changed 10 years ago by
comment:3 Changed 10 years ago by
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
Fix #13019. Disconnected nodes with .replaceWith are a noop. Close gh-1062.
Changeset: f8f52cfcf4ff5d0e3e50a73b03aff0fd9c72105b
comment:4 Changed 10 years ago by
Ref #13019 and gh-1062. Use parentNode check instead of isDisconnected().
Changeset: 2eda329be6ac2f68e9b313ee607ea24165c68755

ref #11338