Setting a sane selected
value when selected item is removed/replaced from the DOM
#65
Labels
selected
value when selected item is removed/replaced from the DOM
#65
Consider a dynamic list, as it's typical in many apps. When this list changes, and the selected value doesn't exist anymore in the new list, what should it equal to afterwards?
There are 2 example cases and I am writing failing tests for both right now, but I want to start a discussion on what you think it should happen to the
selected
property:iron-selector
withattr-for-selected
set tomy-attr
. The children are generated with adom-repeat
, and the currently selected item hasmy-attr=foo
. You then swap the children with different ones. The initially selected valuefoo
is no longer found in the new set of items. What is the selected item and its value?item0
,item1
,item2
...itemn
), and the user selects the last item (itemn
). As a result to another user action,itemn
gets removed from the list. What should the selected item be now?The text was updated successfully, but these errors were encountered: