Open zinkkrysty opened 9 years ago
Can someone confirm, is this actually working sane enough right now, maybe I'm seeing issues where there are none...? It all started with me trying to debug a paper-dropdown-menu and a paper-menu problem with dynamic children...
Having the same problem. Did you manage to find a workaround for this?
Best solution so far seems to be firing iron-select
with an object containing a label and a value property, as seen here. Credit to @davidrissato from the Polymer slack group.
@mattppp: I'm sorry, but I've changed by mistake my original example with another thing completely different. You can find the old example in this snapshot: http://jsbin.com/raleni/7/edit?html,output
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?