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.
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.