Skip to main content

Bug Tracker

Side navigation

#11058 closed bug (duplicate)

Opened December 19, 2011 12:14AM UTC

Closed December 21, 2011 10:51AM UTC

Last modified December 21, 2011 10:51AM UTC

jQuery.clone() ignores dynamically updated "selected" attribute in WebKit, Gecko & Trident.

Reported by: colingourlay Owned by:
Priority: low Milestone: None
Component: manipulation Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking:
Description

I've not dug deep enough to check whether this clone() is using cloneNode or the shim in each of these cases, but on the surface, I've managed to get the expected result using Opera 11's Presto rendering engine, but not in Chrome 17, Firefox 8 or Internet Explorer 9.

Here's a jsFiddle that captures the issue...

Source: http://jsfiddle.net/collypops/WHPZ5/6/

Result: http://jsfiddle.net/collypops/WHPZ5/6/embedded/result/

In the example, I've pre-selected the first option, which is cloned perfectly. Try changing the selected options - you should notice that the 'original' list is updated, yet the 'clone' list remains unchanged.

Of course, this is a fault of the browser engines themselves, but seeing as jQuery's goal is to smooth out browser inconsistencies, perhaps something could be done on this end.

I will also raise issues with the separate browser vendors.

Attachments (0)
Change History (2)

Changed December 21, 2011 10:51AM UTC by sindresorhus comment:1

component: unfiledmanipulation
priority: undecidedlow
resolution: → duplicate
status: newclosed

Changed December 21, 2011 10:51AM UTC by sindresorhus comment:2

Duplicate of #9997.