Bug Tracker

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#11058 closed bug (duplicate)

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

Reported by: Colin Gourlay 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.

Change History (2)

comment:1 Changed 11 years ago by sindresorhus

Component: unfiledmanipulation
Priority: undecidedlow
Resolution: duplicate
Status: newclosed

comment:2 Changed 11 years ago by sindresorhus

Duplicate of #9997.

Note: See TracTickets for help on using tickets.