How to remove small caret from ion-select in ionic4

前端 未结 10 1395
春和景丽
春和景丽 2021-01-17 22:21

I want to remove the inbuilt grey small caret from ion-select, and use my custom caret(arrow) instead.

Code:

ion-select {
  color: grey         


        
10条回答
  •  自闭症患者
    2021-01-17 23:23

    I don't know how to fix, faced same problem, but it seems to be issue with DOM Shadow

    If you will find anything, let to know as well please, thanks.

    Update: Found some answer

    UPDATE #2

    I created directive in order to have access to Shadow DOM and it's able to add styles into isolated DOM.

    HTML:

     
    

    Directive(need to find better implementation):

        constructor(private el: ElementRef) {
    
        setTimeout(() => {
            this.el.nativeElement.shadowRoot.querySelector('.select-icon-inner').setAttribute('style', 'display: none !important');
        }, 3000);
    }
    

提交回复
热议问题