-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
Missing border radius on input group with validation feedback #25110
Comments
Damn, I'm super disappointed in myself for not catching this during Beta 3. I thought I had this all locked up with that rewrite. This is going to be tough. /cc @ysds in case he has ideas having looked at some of this code recently |
I spent an hour on this last night and had nothing, but just had an idea to use the validation state. .form-control,
.custom-select {
&:not(:last-child) { @include border-right-radius(0); }
&:not(:first-child) { @include border-left-radius(0); }
&:not(:last-child):required,
&:not(:last-child).is-valid,
&:not(:last-child).is-invalid {
@include border-right-radius($input-border-radius);
}
} This works on the particular docs example, but I need to see if it doesn't work elsewhere. |
@mdo I am terribly sorry for the lack of confirmation. There is still a issue. e.g. appended addon: <div class="input-group mb-3">
<input type="text" class="form-control is-invalid" placeholder="Recipient's username">
<div class="input-group-append">
<span class="input-group-text">@example.com</span>
</div>
<div class="invalid-feedback">
Please provide a valid zip.
</div>
</div> I created various test cases here. https://codepen.io/fellows3/pen/OzmMoz |
Nice, thanks for the test case. I've forked your pen to:
See https://codepen.io/emdeoh/pen/OzmNNw?editors=1100. Have to improve some custom select and custom file, as well as dealing with the appended as you noted. |
We also have to suppose a |
@ysds That's where I'm hoping |
I don't have any solution with only CSS3 selector to this issue. It would be impossible. I think we should move |
Hmm, that'd be a breaking change from the final beta. I'm pushing for no breaking changes, but we'll see. I agree there doesn't seem to be a solution. I was trying to use some |
I have some real funky CSS for y'all in #25352 to address as much of this as I can. 😅 |
Just dropping my two cents. I'm using v4.0 at the moment, and I was able to get the rounded corners back on the appended button with: <div class="input-group">
<input type="text" class="form-control is-invalid" readonly required>
<div class="input-group-append">
<button class="btn btn-outline-secondary rounded-right" type="button">
Hey
</button>
</div>
<div class="invalid-feedback">
Error
</div>
</div> It needs an extra declaration of |
I guess thats what betas are for. 😉 @altbdoor Jep generally this works. |
I found a solution to the problem using bootstrap's <div class="form-group">
<label for="name">Name</label>
<div class="input-group">
<input type="text" class="form-control" id="name" required>
<div class="invalid-feedback order-1">
Please provide a name.
</div>
<div class="input-group-append">
<span class="input-group-text">
<i class="fas fa-envelope"></i>
</span>
</div>
</div>
</div> |
We've added notes to our documentation and improved examples to incorporate the workarounds here. See #30180 and #25110 (comment). |
We'll also need to revisit this in v5 to see if HTML/CSS breaking changes could fix it without a workaroud. |
…lid-feedback element
Possible fix with a greatly simplified input group component coming for v5. See #31666 and please let me know your thoughts. |
This bug still happens with 5.0.0-beta3 when there are TWO validation fields for a form-group (valid and invalid).
|
New .has-validation class was added so validation feedback can move inside input-group. This works ok for simple_form, but the plain HTML version with both .valid-feedback and .invalid-feedback divs loses the rounded end on the input group. See twbs/bootstrap#25110
New .has-validation class was added so validation feedback can move inside input-group. This works ok for simple_form, but the plain HTML version with both .valid-feedback and .invalid-feedback divs loses the rounded end on the input group. See twbs/bootstrap#25110
* Update bootstrap dependency to 5.0.0.beta2 * .custom-* styles merged in to native ones * Use map-merge to add custom colors to theme * Update header markup * Breadcrumbs have no padding now * data-toggle and data-target get 'bs-' prefix * data-placement gets 'bs-' prefix; drop data-trigger * Drop top margin; update horizontal margin * Rework stack/split button group * Hide toggle buttons below medium breakpoint * data-dismiss gets 'bs-' prefix on modal * Use bootstrap's close button on modal * .form-text now subsumes <small> and .text-muted * Drop .form-group-{invalid,valid} They aren't used by bootstrap and .form-group has gone in v5 as well. * verticals: .form-group -> .mb-3 * verticals: labels need .form-label * verticals: .form-control-file -> .form-control * verticals: .form-control -> .form-select Also add :vertical_select wrapper for `<select>` lists used for associations. Without this, the select elements would use the default :vertical_form wrapper and get the .form-control class. * verticals: .form-control-range -> .form-range * verticals: address layout issue with boolean When a boolean is rendered as radio buttons a hidden `<input>` element is added between the `<legend>` and first `<div>` wrapping a radio button. Bootstrap's styling floats the legend left and needs the following element to be cleared, but this does not work if the following element is not displayed. We add an additional rule to target the first following wrapper `<div>`. * Rework event handling for stack/split toggle .active has gone; check for .btn so we only process events from the input elements, not the labels. Don't preventDefault() on the event, so the radio button will toggle. * Get stack/split state from radio buttons * horizontals: .form-group -> .mb-3 * horizontals: .form-control-file -> .form-control * horizontals: .form-control -> .form-select As for horizontals, add :horizontal_select wrapper for `<select>` lists used for associations. Without this, the select elements would use the default :horizontal_form wrapper and get the .form-control class. * horizontals: .form-control-range -> .form-range * horizontals: better range label/input alignment * horizontals: remove duplicate label on boolean * horizontals: fix margin at bottom of form * inlines: .sr-only -> .visually-hidden * inlines: .form-inline replaced with grid * .custom-* form styles have been dropped * input_groups: .form-group -> .mb-3 * input_groups: labels need .form-label * input_groups: prepend/append wrapper div dropped * input_groups: fix password js Needs updating as .input-group-append wrapper div isn't used any more. * floating_labels: built in with v5 * floating_labels: remove `<select multiple>` example Not supported by Bootstrap 5's floating labels implementation. * floating_labels: .custom-select -> .form-select * floating_labels: docs recommend against rows="" * input_groups: add .has-validation, move feedback New .has-validation class was added so validation feedback can move inside input-group. This works ok for simple_form, but the plain HTML version with both .valid-feedback and .invalid-feedback divs loses the rounded end on the input group. See twbs/bootstrap#25110 * remove .d-block where it is not needed * fix inclusion of stylesheets in documentation * Update version number on home page * Replace .media and .media-body * `div` is the default for `tag` in wrappers * Update bootstrap dependency to 5.0.0 * Add `offcanvas` to `application.scss` * Bump bootstrap rubygem to v5.0.1 Co-authored-by: m5o <[email protected]>
I'm still seeing this bug in v5.1.
|
Please create a new issue with a reference to this one. |
As expected adding the class
|
With new beta 3 and using the new input-group stuff, inputs inside input-groups with some validation feedback after them are missing the border-radius.
red circle: without border-radius
green circle: with border-radius
This is an example from the bootstrap documentation
The text was updated successfully, but these errors were encountered: