ibm-js / deliteful

Multichannel (desktop/mobile) UI Custom Elements Library
http://ibm-js.github.io/deliteful
Other
70 stars 36 forks source link

Combobox: Allow to display a trimmed list instead of "multiple choices" #486

Open tkrugg opened 9 years ago

tkrugg commented 9 years ago

When selecting multiple elements in combobox, "multiple choices" is displayed. I think from a ux perspective, it's better to show a trimmed inlined version of the list of selected elements: even if the user might not be able to see the full list, it's telling him/her clearly what's happening imho, and it's consistent with the case selectionMode=single.

[Option 1                 ] 
[Option 1, Option 2       ] // adding item "Option 2"
[... 1, Option 2, Option 3] // adding item "Option 3"
[... 2, Option 3, Option 4] // adding item "Option 4"
AdrianVasiliu commented 9 years ago

I think it could be added as an optional mode (in addition, not instead of what currently exists). Note however that the labels can be long, and when a bunch are selected displaying a meaningful concatenated and trimmed label might not be that great. The choice of the current way to display the message was done after comparing a number of existing sites using combos in multiple selection mode. Also, the users may have their own preference about how to create the merged label. All in one, if we decide to do something about it, I would favor introducing a protected method for creating the message (which is already customizable but statically), such that an advanced user can override it to suit his needs (while possibly keeping the current mechanism as default implementation).