Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove 'clear all' button with CSS (ng-select field)

How do I remove the "clear button" from a ng-select field with search?

I'm using angular 6 with ng-select package: https://www.npmjs.com/package/@ng-select/ng-select

like image 826
Leonardo Vinicius Avatar asked Dec 13 '18 16:12

Leonardo Vinicius


2 Answers

Add [clearable]="false" attribute to your ng-select tab

Example:

<ng-select class="disable-clear-all" [clearable]="false" [searchable]="false">
</ng-select>
like image 161
Agnieszka J. Avatar answered Nov 15 '22 07:11

Agnieszka J.


In your stylesheet add display: none; to the .ng-clear-wrapper selector.

Like so:

.ng-select .ng-clear-wrapper {
    display: none;
}
like image 33
brooksrelyt Avatar answered Nov 15 '22 09:11

brooksrelyt