]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Require `.has-validation` class to fix border radii on form elements
authorMartijn Cuppens <martijn.cuppens@gmail.com>
Thu, 22 Oct 2020 08:42:05 +0000 (10:42 +0200)
committerMark Otto <otto@github.com>
Mon, 26 Oct 2020 22:23:25 +0000 (15:23 -0700)
scss/forms/_input-group.scss
site/content/docs/5.0/forms/validation.md

index 7a9a14dd7be330f0390718c0a161759cc694ee81..065f8c611777fa7956ecb7639120df39da39bb5a 100644 (file)
 
 // stylelint-disable-next-line no-duplicate-selectors
 .input-group {
-  > :not(:last-child):not(.dropdown-toggle):not(.dropdown-menu),
-  > .dropdown-toggle:nth-last-child(n + 3) {
-    @include border-right-radius(0);
+  &:not(.has-validation) {
+    > :not(:last-child):not(.dropdown-toggle):not(.dropdown-menu),
+    > .dropdown-toggle:nth-last-child(n + 3) {
+      @include border-right-radius(0);
+    }
   }
 
   > :not(:first-child):not(.dropdown-menu) {
index 65b86520311dc655f9ffc3ede2bf36913a8bec4e..a3fa32689abea0170a6055dfe5a5b3fd1cb6fa14 100644 (file)
@@ -165,6 +165,8 @@ We recommend using client-side validation, but in case you require server-side v
 
 For invalid fields, ensure that the invalid feedback/error message is associated with the relevant form field using `aria-describedby` (noting that this attribute allows more than one `id` to be referenced, in case the field already points to additional form text).
 
+To fix [issues with border radii](https://github.com/twbs/bootstrap/issues/25110), input groups require an additional `.has-validation` class.
+
 {{< example >}}
 <form class="row g-3">
   <div class="col-md-4">
@@ -183,7 +185,7 @@ For invalid fields, ensure that the invalid feedback/error message is associated
   </div>
   <div class="col-md-4">
     <label for="validationServerUsername" class="form-label">Username</label>
-    <div class="input-group">
+    <div class="input-group has-validation">
       <span class="input-group-text" id="inputGroupPrepend3">@</span>
       <input type="text" class="form-control is-invalid" id="validationServerUsername" aria-describedby="inputGroupPrepend3 validationServerUsernameFeedback" required>
       <div id="validationServerUsernameFeedback" class="invalid-feedback">
@@ -314,7 +316,7 @@ If your form layout allows it, you can swap the `.{valid|invalid}-feedback` clas
   </div>
   <div class="col-md-4 position-relative">
     <label for="validationTooltipUsername" class="form-label">Username</label>
-    <div class="input-group">
+    <div class="input-group has-validation">
       <span class="input-group-text" id="validationTooltipUsernamePrepend">@</span>
       <input type="text" class="form-control" id="validationTooltipUsername" aria-describedby="validationTooltipUsernamePrepend" required>
       <div class="invalid-tooltip">