Bug Tracker

Opened 11 years ago

Closed 11 years ago

#4193 closed bug (wontfix)

.clone() selected items lose select in FF but not in IE

Reported by: lhwparis Owned by:
Priority: minor Milestone: 1.3.2
Component: core Version: 1.3.1
Keywords: clone select option Cc:
Blocked by: Blocking:

Description

when i clone one or more selected <option> from one <select> to another there are differences between IE and firefox.

in IE the cloned element (in the second <select>) stays selected. in firefox the cloned element is not selected.

so which one is correct?

the code:

$('#myselect option:selected').clone().appendTo($('#myselect2'));

Change History (4)

comment:1 Changed 11 years ago by dmethvin

Summary: .clone() selected items loose select in FF but not in IE.clone() selected items lose select in FF but not in IE

comment:2 Changed 11 years ago by dmethvin

This is probably related to #2941 but isn't the same issue.

comment:3 Changed 11 years ago by dmethvin

Keywords: clone select option added

comment:4 Changed 11 years ago by brandon

Resolution: wontfix
Status: newclosed

This was at one time in core but was removed due to the large performance overhead for such an edge case. I'm not convinced that the values should be cloned with the form elements. To really make it work cross browser you'd have to change the name attributes and ids as well. I remember having issues with radio buttons in Opera where even though it was in a different form only one could be checked. Either the original or the clone.

see also #3716 and #2941

Note: See TracTickets for help on using tickets.