select2-bootstrap4-theme icon indicating copy to clipboard operation
select2-bootstrap4-theme copied to clipboard

Doesn't support form-control-sm ?

Open slammedunc opened this issue 6 years ago • 7 comments

I think it needs to be updated to support form-control-sm instead of input-sm?

slammedunc avatar Nov 14 '18 10:11 slammedunc

I think the same.

hhsm95 avatar Dec 10 '18 19:12 hhsm95

Did either of you find a solution to this? @adeoy @slammedunc

clarg18 avatar Oct 18 '19 21:10 clarg18

@Glendog I added the following to my css file:

/* force select2 to match bootstrap form-control-sm */ .select2, .select2-selection__rendered { line-height: calc(1.5em + .5rem + 2px) !important; } .select2-container .select2-selection--single { height: calc(1.5em + .5rem + 2px) !important; } .select2-selection__arrow { height: calc(1.5em + .5rem + 2px) !important; }

slammedunc avatar Oct 21 '19 06:10 slammedunc

@slammedunc Can you test on all browsers and then PR that please?

VictorioBerra avatar Oct 21 '19 15:10 VictorioBerra

@VictorioBerra sorry should have said I'm not using this theme (or any other) just the above

slammedunc avatar Oct 22 '19 03:10 slammedunc

I use some trick and add more additional css tyle. Used on js:

$('.select2InitB4-sm',document).select2({
    placeholder: "--Select--",
    allowClear: true,
    theme: 'bootstrap4',
    width: '100%',
    containerCssClass: 'form-control-sm'
});
$('.select2InitB4',document).select2({
    placeholder: "--Select--",
    allowClear: true,
    theme: 'bootstrap4',
    width: '100%'
});

add some css style

/* force select2 to match bootstrap form-control-sm */
.select2-container--bootstrap4 .select2-selection--single.form-control-sm .select2-selection__placeholder {
    color: #757575;
    line-height: 1.25rem;
}
.select2-container--bootstrap4 .select2-selection--single.form-control-sm .select2-selection__rendered {
    line-height: 1.25rem;
}
.select2-container--bootstrap4 .select2-selection--single.form-control-sm {
    height: calc(1.25rem + 11px)!important;
}
.select2-container--bootstrap4 .select2-selection--single.form-control-sm .select2-selection__clear {
    margin-top: 0.1em!important;
    margin-right: 0!important;
}

whendy avatar Jan 17 '23 13:01 whendy

I add this css. Use combining the both .form-select-sm

 .select2-container--bootstrap-5 .select2-dropdown .select2-results__options  .select2-results__option, .select2-search__field {
    min-height: calc(1.5em + .5rem + 2px) !important;
    padding: .25rem .5rem  !important;
    font-size: .875rem  !important;
}

lkonsam avatar Oct 18 '23 07:10 lkonsam