Bootstrap-select: How to remove caret class ?

Created on 16 Jul 2015  路  7Comments  路  Source: snapappointments/bootstrap-select

after applying class="selectpicker" in my select list it working fine , I just want to remove the 'caret class' can some one help me to do that
se

Most helpful comment

@jaychacko Bootstrap 4 adds a caret automatically via CSS (.dropdown-toggle::after) using the border trick, you'll need to disable it that way. Remove all references to borders in that CSS rule and it should fix it.

All 7 comments

This is a new feature, and is not yet in an official release, but in the options, you set:

$.fn.selectpicker.defaults = {
    template: {
        caret: ''
    }
}

or, in your CSS you can do

.bootstrap-select .bs-caret {
    display: none;
}

good one, thanks! i think should be closed now :]

@caseyjhol Thats not working for me. I have done this and made the icon i want showed up but cant remove the default carret
.dropdown-toggle::after { font-family: "Ionicons"; display: inline-block; content:'\f123'; width: 0; height: 0; margin-left: .255em; vertical-align: .255em; border-top: .3em solid; border-right: .3em solid transparent; border-bottom: 0; border-left: .3em solid transparent; }
image

.bootstrap-select .bs-caret { display: none; } not working for me either

@jaychacko What version of Bootstrap are you using?

@caseyjhol What version of Bootstrap are you using?

using bootstrap 4.0.0
Check out my full code attempt
https://github.com/jaychacko/bootstrap-select

@jaychacko Bootstrap 4 adds a caret automatically via CSS (.dropdown-toggle::after) using the border trick, you'll need to disable it that way. Remove all references to borders in that CSS rule and it should fix it.

@caseyjhol wow that worked, thanks

Was this page helpful?
0 / 5 - 0 ratings