Side navigation
#6261 closed bug (fixed)
Opened March 11, 2010 02:34AM UTC
Closed March 31, 2011 03:41PM UTC
clone(false) inserts empty nodes in IE
Reported by: | Eddie | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | |
Component: | manipulation | Version: | 1.4.2 |
Keywords: | clone true false ie insert inserts blank | Cc: | |
Blocked by: | Blocking: |
Description
$('#myElement').clone(false) inserts empty nodes in IE while $('#myElement').clone(true) doesn't.
An example:
<ul id="myElement"> <li><span>Test</span><div> </div></li> </ul>
$('#myElement').clone(true) will end up in:
<ul id="myElement"> <li><span>Test</span><div> </div></li> </ul>
$('#myElement').clone(false) will end up in:
<ul id="myElement"> <li><span>Test</span> <div> </div></li> </ul>
Mark the space directly after the closing </span>. This will mess up certain designs in IE 8 (and maybe others). See attached Screenshots.
Attachments (3)
Change History (4)
Changed June 15, 2010 12:32AM UTC by comment:1
component: | unfiled → manipulation |
---|
Changed September 27, 2010 12:30AM UTC by comment:2
priority: | → undecided |
---|
I get the same behavior with an extraneous text node, regardless of whether
.clone()is called with true or false. In the clone code you can see that this.outerHTML is returning markup with the extra spaces. This probably isn't fixable unless we find a solution that doesn't involve outerHTML.
Changed October 23, 2010 09:27PM UTC by comment:3
milestone: | 1.4.3 → 1.5 |
---|---|
priority: | undecided → low |
status: | new → open |
Changed March 31, 2011 03:41PM UTC by comment:4
_comment0: | No longer an issue in 1.5 → 1301586113660514 |
---|---|
resolution: | → fixed |
status: | open → closed |
No longer an issue in 1.5 - http://jsfiddle.net/danheberden/kaa8D/