How to remove small caret from ion-select in ionic4

前端 未结 10 1327
春和景丽
春和景丽 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:13

    To modify the icon, call this function

    async removeSelectCaret(id){
        const select = await (window.document.querySelector(`#${id}`) as HTMLIonSelectElement).componentOnReady();
        select.shadowRoot.childNodes[1]['style'].display="none";
      }
    

提交回复
热议问题