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 comment:1
component: | unfiled → manipulation |
---|---|
priority: | undecided → high |
status: | new → open |
Changed September 04, 2012 03:00PM UTC by comment:2
owner: | → rod@vagg.org |
---|---|
status: | open → pending |
Changed September 05, 2012 02:23AM UTC by comment:3
status: | pending → new |
---|
@timmywil: this should do it: http://jsfiddle.net/fHhKf/4/
Changed September 05, 2012 12:21PM UTC by comment:4
status: | new → assigned |
---|
Changed September 08, 2012 07:05PM UTC by comment:5
milestone: | None → 1.9 |
---|
See additional discussion in https://github.com/jquery/jquery/pull/920
Thanks for writing tests in the pull! Just for clarity's sake, do you have a fiddle somewhere that also demonstrates the problem?