- From: Vladimir Varlamov <notifications@github.com>
- Date: Fri, 30 Nov 2018 20:18:17 +0000 (UTC)
- To: whatwg/dom <dom@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/dom/issues/644/443327051@github.com>
Let's see what is being done in libraries. Take this. Оne of those that did a lot in due time to show that standards need to be changed. https://api.jquery.com/clone/ ([jquery src code of clone](https://github.com/jquery/jquery/blob/9b77def560212d12fef2d0b9c12aa50727e3e5d7/src/manipulation.js#L242)) : > Note: For performance reasons, the dynamic state of certain form elements (e.g., user data typed into textarea and user selections made to a select) is not copied to the cloned elements. When cloning input elements, the dynamic state of the element (e.g., user data typed into text inputs and user selections made to a checkbox) is retained in the cloned elements. Hmm, see related bug. https://bugs.jquery.com/ticket/1294 : > Changed 11 years ago by brandon The fix for this is to expensive for the core and has been removed in 1.2. The workaround is simple. Just copy the selectedIndex from the original. The library would copy the state, but refer to performance. At least he understands that this is important and documented this. Other voices https://stackoverflow.com/questions/742810/clone-isnt-cloning-select-values (viewed | 31,738 times) https://bugs.jquery.com/ticket/10550#comment:6 https://stackoverflow.com/questions/17274081/javascript-jquery-clone-not-working-in-dropdown-list https://stackoverflow.com/questions/7450032/clone-a-row-containing-selects-and-clone-selects-values https://stackoverflow.com/questions/44983149/javascript-clone-node-is-not-copying-all-values-from-cloned-to-new-object https://github.com/Polymer/polymer/issues/2112 https://stackoverflow.com/questions/3776270/jquery-clone-doesnt-copy-select-dom-properties P.S. Maybe backward compatibility is not relevant here such great importance? Anyway everyone expects this behavior and copy the state. So if the native function does it right away, then nothing will change. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/whatwg/dom/issues/644#issuecomment-443327051
Received on Friday, 30 November 2018 20:18:42 UTC