Skip to content

input-group looks compressed and broken. #28782

@jenstroeger

Description

@jenstroeger

(Mac OS Mojave 10.14.4, Chrome 74.0.3729.157)

Looking at the following code for an input-group

.input-group {
position: relative;
display: flex;
flex-wrap: wrap; // For form validation feedback
align-items: stretch;
width: 100%;
> .form-control,
> .form-control-plaintext,
> .custom-select,
> .custom-file {
position: relative; // For focus state's z-index
flex: 1 1 auto;
// Add width 1% and flex-basis auto to ensure that button will not wrap out
// the column. Applies to IE Edge+ and Firefox. Chrome does not require this.
width: 1%;
margin-bottom: 0;
+ .form-control,
+ .custom-select,
+ .custom-file {
margin-left: -$input-border-width;
}
}

there are two interesting lines here: line 10 (flex-wrap: wrap) and line 22 (width: 1%) which seem to be the cause for the following rendering

input-group

And the code is

<div class="input-group input-group-sm">
  <select class="custom-select" name="some-name"></select>
  <div class="input-group-append">
    <button class="btn btn-outline-secondary dropdown-toggle" type="button" data-toggle="dropdown"></button>
    <div class="dropdown-menu vw-30 p-2"></div>
  </div>
</div>

I’ve fixed this by adding flex-wrap: nowrap to the input group itself, and width: auto to the select element further down in the cascade. But I am curious about why these two values were chosen in the first place? Shouldn’t the flex-wrap be at least nowrap to ensure that an input group doesn’t break visually?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions