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

Support for disabling whole drop-down box

Open RealGizmo opened this issue 10 years ago • 11 comments

It would be nice if the directive would offer the possibility to disable the whole drop-down box and not just the individual elements. This could be easily done by adjusting the template to something like this:

'<button ng-if="!isDisabled" type="button" class="button multiSelectButton" ng-click="toggleCheckboxes( $event ); refreshSelectedItems(); refreshButton();" ng-bind-html="varButtonLabel">' +
                '<button ng-if="isDisabled" type="button" class="button multiSelectButton disabled" ng-bind-html="varButtonLabel">' +

Hence if the isDisabled attribute is true the drop-down itself will be disabled. IMHO this makes sense as the user doesn't have to first click to then find out that not a single item can be selected.

What do you think, can this little extension go into the code?

RealGizmo avatar Feb 12 '15 11:02 RealGizmo

Hi @RealGizmo ,

The reason behind this is; I want the users to still be able to see the available selections -even when disabled- thus I don't disable the whole dropdown box.

However yeah you can easily customize that if you need it :)

isteven avatar Feb 14 '15 00:02 isteven

Understood. What about adding another attribute "disableDropDown" for making this configurable for those customers who want it ;) ?

RealGizmo avatar Feb 14 '15 10:02 RealGizmo

Great work @isteven. This directive helps solve a pretty common problem where traditional html falls short. I agree with @RealGizmo on the disable point though. Since this mimics the behavior of an html form control, it seems logical to at least include the option to disable it since all form controls support the disable attribute. I can understand your reasoning @isteven, but this behavior deviates from the normal set of html form controls and might not be what a seasoned developer using a form element would expect.

ndicenso avatar Feb 26 '15 03:02 ndicenso

+1 for disabling the dropdown. The current disabling behavior is slightly disorienting.

abingham avatar May 05 '15 12:05 abingham

:+1: for disabling the dropdown. I was looking around the documentation and couldn't find a solution to this. I would simply like to disable a button based on the response to a previous button.

patrickmichalina avatar May 29 '15 20:05 patrickmichalina

+1 for disabling the dropdown.

JayHuang avatar May 30 '15 01:05 JayHuang

Hi all,

Noted.. will provide this much requested feature in the next release. Cheers.

isteven avatar May 30 '15 03:05 isteven

I'm just found that I need it too :+1: :)

djindjic avatar Jun 12 '15 05:06 djindjic

Hi I was wondering if this feature has been implemented yet. Thanks!

kabu14 avatar Sep 01 '16 19:09 kabu14

+1 for disabling the dropdown.

konczak avatar Sep 15 '16 14:09 konczak

+1 for disabling the dropdown

Xeloss avatar Jan 06 '20 20:01 Xeloss