iron-selector icon indicating copy to clipboard operation
iron-selector copied to clipboard

Disabled items can't be selected

Open reinert opened this issue 9 years ago • 6 comments

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:

  • When selected property is manually changed
  • When a selected item becomes disabled

reinert avatar Feb 10 '16 21:02 reinert

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

reinert avatar Feb 10 '16 22:02 reinert

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.

bicknellr avatar Feb 16 '16 18:02 bicknellr

Ok. I will.

reinert avatar Feb 17 '16 02:02 reinert

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

reinert avatar Feb 18 '16 00:02 reinert

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

bicknellr avatar Feb 19 '16 23:02 bicknellr

Good!

reinert avatar Feb 20 '16 00:02 reinert