In my Angular application, I have an instance of the ng-select widget:
If you click on it, by default you can search for items and add more of them to the current selection:
I would like to change this default behaviour, in particular:
So this is how I would like it to be:
In order to achieve this, we first need to create 3 css classes.
One to disable the arrow-down icon:
.ng-select.disable-arrow .ng-arrow-wrapper .ng-arrow {
display: none;
}
One to disable the search/list dropdown:
.ng-select.disable-dropdown ng-dropdown-panel {
display: none;
}
One to disable the clear-all X icon:
.ng-select.disable-clear-all .ng-clear-wrapper {
display: none;
}
Then we add the ng-select
element using the 3 css classes that we created, plus a few options:
<ng-select
class="disable-arrow disable-dropdown disable-clear-all"
[searchable]="false"
[clearable]="true"
[multiple]="true"
>
</ng-select>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With