Bootstrap: [v4b3][input-group] Middle text between two form-control become ugly

Created on 10 Jan 2018  路  2Comments  路  Source: twbs/bootstrap

Before the b3 we can do this with simple html code :

<div class="input-group input-group-sm">
        <input class="form-control form-control-sm" type="text">
        <div class="input-group-addon">@</div>
        <select class="form-control form-control-sm"></select>
</div>

But now, we have to do that :

<div class="input-group input-group-sm">
       <div class="input-group-prepend">
                <input  class="form-control form-control-sm input-group-prepend" type="text">
                <div class="input-group-text">@</div>
        </div>
        <select  class="form-control"></select>
</div>

It's become less readable. So have I miss something or the beta 3 input-group are now less easy to use ?

Note that if I don't put "form-control-sm" in the first input, the "input-group-sm" is not take in account. Seem's to be a bug if I refere to the input-group doc.

css v4

Most helpful comment

Assign both input-group-prepend and input-group-append to the addon element. There's a ticket for this.

All 2 comments

Assign both input-group-prepend and input-group-append to the addon element. There's a ticket for this.

Effectively, this html code work fine and is more clean :

<div class="input-group input-group-sm">
                <input class="form-control" type="text">
                <div class="input-group-prepend input-group-append">
                    <div class="input-group-text">@</div>
                </div>
                <select class="form-control"></select>
            </div>

Thank you for your reply alecpl 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kamov picture kamov  路  3Comments

devfrey picture devfrey  路  3Comments

knownasilya picture knownasilya  路  3Comments

bellwood picture bellwood  路  3Comments

IamManchanda picture IamManchanda  路  3Comments