angular-multi-select icon indicating copy to clipboard operation
angular-multi-select copied to clipboard

"none" helper does not show up when using `selection-mode="single"`

Open dailytabs opened this issue 8 years ago • 2 comments

When in single selection mode, using helper-elements="none filter" the "Select None" button does not show up (the search filter does show up). This prevents the user from being able to go back to having nothing selected, without me intervening with logic of my own and another UI element.

dailytabs avatar Aug 16 '17 15:08 dailytabs

+1 Yeah!.., I would need this too... Do you think it is too difficult to implement @isteven ? If you guide me guys I could implement and push it. Thanks!

ladaltamirano avatar Jan 17 '18 14:01 ladaltamirano

Hi @Acaspita ,

The single selection mode intends to mimic the usual HTML dropdown. Hence you cannot "unselect" a selection. What you can do is to add an extra row into your input-model like:

var inputData = [ 
    { title: '[Please select an item]', value: 0, ticked: true }, 
    { title: 'Item 1', value: 1, ticked: false }, 
    { title: 'Item 2', value: 2, ticked: false }, 
    ...
];

And validate before you save your form that, if "[Please select an item]" is selected, it doesn't count (or it's not part of the data).

Edit: it shouldn't be too hard to implement, but unfortunately I won't be able to guide you as I'm quite occupied with a lot of stuffs.

isteven avatar Jan 23 '18 06:01 isteven