#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 11 years ago by
Component: | unfiled → manipulation |
---|---|
Keywords: | needsdocs added |
Priority: | undecided → low |
Resolution: | → invalid |
Status: | new → closed |
comment:2 Changed 11 years ago by
Keywords: | needsdocs removed |
---|
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.