I am currently using ng-select for drop down like
<ng-select [items]="tests"
(data)="signalChanged($event)"
[active]="test"
id="test)">
</ng-select>
I want to change the back ground color of the active element in the drop down list. How do I access it's css?
Both APIs ::ng-deep and /deep/ are deprecated and will eventually be removed in the future.
In your stylesheet add display: none; to the . ng-clear-wrapper selector.
The best way to do this is by using reactive form control. [readonly] boolean false no Set ng-select as readonly. Mostly used with reactive forms. adding [disabled]="true" did not work for me But setting [readOnly] to true did.
You can customize as per official documentation. To find exact class you need to override, do inspect and identify the class.
<ng-select class="custom"></ng-select>
.ng-select.custom {
border:0px;
min-height: 0px;
border-radius: 0;
}
.ng-select.custom .ng-select-container {
min-height: 0px;
border-radius: 0;
}
If you are using ViewEncapsulation, your should use special ::ng-deep selector which will prevent scoping for nested selectors.
.ng-select.custom ::ng-deep .ng-select-container {
min-height: 0px;
border-radius: 0;
}
https://www.npmjs.com/package/@ng-select/ng-select#custom-styles has more details around the same.
I suggest you override the styles as mentioned here. In addition to that try setting the Encapsulation for the component.
encapsulation: ViewEncapsulation.None
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