I am using the npm package ng-multiselect-dropdown for multiple select in my angular project and its working fine except one case like below:
we have one selected field and it's also disabled. but when I clicked on select All then it's deselected first and select other fields and after that I am not able to select this disabled option again. So my question is now how can we stop this I mean disabled value should not be deselected on choose Select All/Deseclect All.
you can check in below link also
First of all: It is not the best user experience to select disabled items. But if you wanna do it you can it do with a little trick:
Use the
onSelectAll
method on your dropdown.(onSelectAll)="onSelectAll($event)"
And then set it again on
onSelectAll
. the "...this.selectedItems1" clone the object and then we add the two disabled items. CodeBut a
onDeselectAll
function does not exists. So onunselectAll
all items are deselected.In the end: This is not a bug, this is the expect behavior, look here: