You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Open the demo above, which contains an iron-selector and a dom-repeat inside, which generates a list of selectable items from an array, using attrForSelected to identify each item's value.
Click the 'Change order' button. This will reset the dom-repeat array with a brand new list of items, containing the same number of items with the same values, but in a different order.
Observe the currently-selected item in the list.
Actual outcome
The second item in the list remains selected even as the order of the items is changed and the second item's value is now "four", not "two".
Expected outcome
The item with the name "two" should be selected, since the selected value "two" did not change and there is still a valid item with this value in the list.
I believe this is happening because a simple re-ordering of the dom-repeat array only results in the attrForSelected attribute values being updated, with no DOM nodes being added or removed, so updateItems/updateSelected is not called.
The text was updated successfully, but these errors were encountered:
sklobovskaya
changed the title
Selection not updated when DOM elements are reordered
Selected element not updated when DOM elements are reordered
Jul 27, 2016
Description
When the selectable elements in an iron-selector are reordered, the selected element is not updated.
Demo and steps to reproduce
http://jsbin.com/huyupeh/edit?html,js,output
attrForSelected
to identify each item's value.Actual outcome
The second item in the list remains selected even as the order of the items is changed and the second item's value is now "four", not "two".
Expected outcome
The item with the name "two" should be selected, since the selected value "two" did not change and there is still a valid item with this value in the list.
I believe this is happening because a simple re-ordering of the dom-repeat array only results in the attrForSelected attribute values being updated, with no DOM nodes being added or removed, so updateItems/updateSelected is not called.
The text was updated successfully, but these errors were encountered: