Skip to main content

Bug Tracker

Side navigation

#12449 closed bug (fixed)

Opened September 03, 2012 11:46PM UTC

Closed December 05, 2012 02:50AM UTC

replaceWith() doesn't clone elements where required

Reported by: rod@vagg.org Owned by: rod@vagg.org
Priority: high Milestone: 1.9
Component: manipulation Version: 1.8.0
Keywords: Cc:
Blocked by: Blocking:
Description

(from https://github.com/jquery/jquery/pull/920)

I thought I'd try jQuery over the new comprehensive test suite we have for the various insertion methods in Bonzo and discovered that jQuery's

replaceWith()
wasn't properly cloning where required.

Inside

replaceWith()
this.each()
is used which then passes a singular collection for each element in this to
before()
or
append()
which then invokes
domManip()
, the clone check inside
domManip()
(see
iNoClone = results.cacheable || l - 1
-- l always == 1).

Attachments (0)
Change History (7)

Changed September 04, 2012 02:59PM UTC by timmywil comment:1

component: unfiledmanipulation
priority: undecidedhigh
status: newopen

Thanks for writing tests in the pull! Just for clarity's sake, do you have a fiddle somewhere that also demonstrates the problem?

Changed September 04, 2012 03:00PM UTC by timmywil comment:2

owner: → rod@vagg.org
status: openpending

Changed September 05, 2012 02:23AM UTC by rod@vagg.org comment:3

status: pendingnew

@timmywil: this should do it: http://jsfiddle.net/fHhKf/4/

Changed September 05, 2012 12:21PM UTC by mikesherov comment:4

status: newassigned

Changed September 08, 2012 07:05PM UTC by dmethvin comment:5

milestone: None1.9

See additional discussion in https://github.com/jquery/jquery/pull/920

Changed December 05, 2012 02:23AM UTC by rwaldron comment:6

#13001 is a duplicate of this ticket.

Changed December 05, 2012 02:50AM UTC by Rod Vagg comment:7

resolution: → fixed
status: assignedclosed

Fixes #12449. make replaceWith() clone elements where required. Closes gh-920

Changeset: 551c2c9f4ac776b6d53600c452ad40a4b4d6670b