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

[v5] form-check-input inside input-group-text is not vertically centered #32857

Closed
bggardner opened this issue Jan 20, 2021 · 1 comment · Fixed by #32912
Closed

[v5] form-check-input inside input-group-text is not vertically centered #32857

bggardner opened this issue Jan 20, 2021 · 1 comment · Fixed by #32912

Comments

@bggardner
Copy link

In v5.0, checkboxes and radios inside .input-group-text elements appear too low (not vertically centered) due to margin-top: .25em set by .form-check-input. v4.6 has:

.input-group-text input[type=checkbox, .input-group-text input[type=radio] { margin-top: 0; }

The fix would be to add either the same as v4.6 or .input-group-text .form-check-input { margin-top: 0; }

@bggardner
Copy link
Author

bggardner commented Jan 20, 2021

Alternatively, change the docs example to put the checkbox inside a .form-check, which appears to vertically center the checkbox:

<div class="input-group mb-3">
  <div class="input-group-text">
    <div class="form-check">
      <input class="form-check-input" type="checkbox" value="" aria-label="Checkbox for following text input">
    </div>
  </div>
  <input type="text" class="form-control" aria-label="Text input with checkbox">
</div>

<div class="input-group">
  <div class="input-group-text">
    <div class="form-check">
      <input class="form-check-input" type="radio" value="" aria-label="Radio button for following text input">
    </div>
  </div>
  <input type="text" class="form-control" aria-label="Text input with radio button">
</div>

However, this adds extra whitespace on the right/end, so it is only a solution if followed by a text label.

@bggardner bggardner changed the title [v5] form-check-input inside input-group-text needs margin-top removed [v5] form-check-input inside input-group-text is not vertically centered Jan 20, 2021
@mdo mdo added this to Inbox in v5.0.0-beta3 via automation Jan 27, 2021
v5.0.0-beta3 automation moved this from Inbox to Done Jan 28, 2021
@XhmikosR XhmikosR removed this from Done in v5.0.0-beta3 Jan 28, 2021
@XhmikosR XhmikosR added this to Inbox in v5.0.0-beta2 via automation Jan 28, 2021
@XhmikosR XhmikosR moved this from Inbox to Done in v5.0.0-beta2 Jan 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
v5.0.0-beta2
  
Done
Development

Successfully merging a pull request may close this issue.

2 participants