Bug Tracker

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#12479 closed bug (invalid)

Clone Flaw Undocumented

Reported by: anonymous Owned by:
Priority: low Milestone: None
Component: manipulation Version: 1.8.0
Keywords: Cc:
Blocked by: Blocking:

Description

As http://bugs.jquery.com/ticket/1294 explains, $('select').clone() will NOT clone the selection the user has made to the select. As per that bug, clone will never get a fix for this issue (due to performance reasons).

That's all well and good, but there's no reason to leave jQuery users in the dark; we shouldn't have to wade through endless comments/blog posts/message boards/Stack Overflow questions just to learn that this is "working as intended". A simple addition of one sentence to clone's documentation would remedy matters:

"NOTE: For performance reasons clone does not copy the selectedIndex of cloned select elements; you can work around this limitation by separately copying the selectedIndex to your cloned select."

Change History (3)

comment:1 Changed 6 years ago by dmethvin

Component: unfiledmanipulation
Keywords: needsdocs added
Priority: undecidedlow
Resolution: invalid
Status: newclosed

More generally, we don't try to copy the dynamic state to the cloned element. So if the user changes a select or types different text into a text box, those changes don't end up being copied. We can add docs to that effect.

comment:2 Changed 6 years ago by mikesherov

Keywords: needsdocs removed

comment:3 Changed 6 years ago by timmywil

#12849 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.