-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Select element value not maintained when dragging #260
Comments
This is a limitation on the way how |
Would it be possible to add an option that allows me to provide a callback that generates the clone element? Although in the example I provided above modifying the mirror element is fairly trivial, in the project I'm currently working on it would be easier for me to generate clone myself than to modify an existing element. |
No, sorry. Use the |
See #248 |
For anyone reading this in the future, I managed to work around the limitations of $("#container").on("change", "select", function() {
var index = this.selectedIndex;
$(this)
.find("option")
.removeAttr("selected") // Changes the selectedIndex. That's why I saved a copy.
.eq(index)
.attr("selected", "selected"); // Attributes will get cloned, properties will not.
}); I'm using jQuery for this, but you could do it as well with just JavaScript. Hope this helps. |
When dragging an item containing a
<select>
element, the<option>
selected in the original item is not the same as the<option>
selected in the mirror element.Here is a short example:
Note that as you drag the item the incorrect option is being displayed on the mirror element.
I've tested this in Firefox and Chrome.
The text was updated successfully, but these errors were encountered: