PolymerElements / iron-menu-behavior

Accessible menu behavior
18 stars 28 forks source link

Allow deselection #59

Open ebidel opened 8 years ago

ebidel commented 8 years ago

I find myself increasingly wanting a way to deselect an item once it is selected. Currently, the only want to do this is use mult, but allowing multiple selection is not always desired.

In the past, I've worked around this by using the iron-deselected event manually deselected the item in js :(

bicknellr commented 8 years ago

selector.select(undefined) should do it. There's kind of a mismatch between IronSelectableBehavior and IronMultiSelectable behavior though: .select(undefined) for a multi-selectable will actually push undefined to selectedValues. :/

bicknellr commented 8 years ago

Calling this p2 just because there's a pretty straight-forward workaround but this is staying open / should be kept in mind when we get to the point that we can make API changes. The current state of iron-selector is pretty poorly defined and crappy to work with concerning this case. I think IronSelectableBehavior and IronMultiSelectableBehavior might need to be split a bit more than they are now.