PolymerElements / iron-selector

Manages a list of elements that can be selected
32 stars 55 forks source link

Disabled items can't be selected #107

Open reinert opened 8 years ago

reinert commented 8 years ago

This is an initial proposed solution for #99.

Basically it prevents select method to set a disabled item as selected. Also selectNext and selectPrevious are covered: they try to find the nearest enabled item. These three methods now return true if an item was selected or false otherwise.

Not covered situations yet:

reinert commented 8 years ago

Also, should there be a feature toggle like skipDisabledItems allowing the user to decided whether disable items should be selectable or not?

bicknellr commented 8 years ago

Hey, just wanted to let you know this PR hasn't gone unnoticed and we'll get to it soon. Ping me here if 'soon' stops being accurate.

reinert commented 8 years ago

Ok. I will.

reinert commented 8 years ago

Idea: provide an attr-for-disabled option so the user can determine what attribute will be queried to check the disabled state. Default value, obviously, would be 'disabled'.

bicknellr commented 8 years ago

btw, I was poking around in paper-radio-group and found that it also implements this: https://github.com/PolymerElements/paper-radio-group/blob/3ee7a79/paper-radio-group.html#L164

reinert commented 8 years ago

Good!