Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove small caret from ion-select in ionic4

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

Code:

ion-select {
  color: grey;
  background:url("/assets/resources/img/ArrowDownConfig.svg");
}

But my css code is unable to precedence over the ionic(inbuilt).

You can see there are two arrows in the image, one is inbuilt and another is custom. I want to remove inbuilt(ionic) one.

enter image description here

like image 626
Kunal Ranjan Avatar asked Mar 22 '19 13:03

Kunal Ranjan


People also ask

How do I remove ion item border?

How do you remove the border on an ion item? May be ion-col, ion-row has some css which is showing the border. Usually in grid systems there is padding in place to create "air" between the blocks. I think style="padding: 0" on your ion-col element should do the trick.

How do you hide ion items?

The Option button is created using an ion-option-button directive. These buttons are showed when the list item is swiped to the left and we can hide it again by swiping the item element to the right.

How do you use ionic select?

Selects are form controls to select an option, or options, from a set of options, similar to a native <select> element. When a user taps the select, a dialog appears with all of the options in a large, easy to select list. A select should be used with child <ion-select-option> elements.


1 Answers

To remove the icon,

 ion-select::part(icon) {
    display: none !important;
   }

To modify the icon,

  ion-select::part(icon) {
    color: #ffa612 !important;
   }
like image 149
Rohinibabu Avatar answered Oct 05 '22 06:10

Rohinibabu