Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

input-group validation wrong right border color #33204

Closed
tkrotoff opened this issue Feb 25, 2021 · 1 comment · Fixed by #33211
Closed

input-group validation wrong right border color #33204

tkrotoff opened this issue Feb 25, 2021 · 1 comment · Fixed by #33211

Comments

@tkrotoff
Copy link
Contributor

tkrotoff commented Feb 25, 2021

Applies to Bootstrap 4.6.0 & 5.0.0-beta2.

Consider this 4.6.0 code:

<div class="input-group">
  <input class="form-control is-invalid">
  <div class="input-group-append">
    <button type="button" class="btn btn-outline-secondary">Button</button>
  </div>
</div>

https://codepen.io/tkrotoff/pen/rNWYbyJ?editors=1100

We get:
Screen Shot 2021-02-25 at 20 11 43

Instead of:
Screen Shot 2021-02-25 at 20 12 26

==> the input right border should be red instead of grey

The same happens with 5.0.0-alpha2: https://codepen.io/tkrotoff/pen/MWbrNpp?editors=1100

<div class="input-group">
  <input class="form-control is-invalid">
  <button type="button" class="btn btn-outline-secondary">Button</button>
</div>

Quick fix:

// 4.6.0
.input-group {
  .form-control.is-invalid,
  .custom-select.is-invalid {
    z-index: 3;
  }
}

// 5.0.0-beta2
.input-group {
  .form-control.is-invalid,
  .form-select.is-invalid {
    z-index: 3;
  }
}

FYI when focusing on the input, the right border is OK:

Screen Shot 2021-02-25 at 20 14 50

because of this code:

// Bring the "active" form control to the top of surrounding elements
> .form-control:focus,
> .form-select:focus {
  z-index: 3;
}

https://github.com/twbs/bootstrap/blob/v5.0.0-beta2/scss/forms/_input-group.scss#L20-L24

@tkrotoff tkrotoff changed the title input-group is-invalid wrong right border color input-group validation wrong right border color Feb 25, 2021
@ffoodd
Copy link
Member

ffoodd commented Feb 26, 2021

I guess it makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants