]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Docs: add indeterminate disabled checkbox example (#36674)
authorJulien Déramond <julien.deramond@orange.com>
Wed, 6 Jul 2022 05:43:38 +0000 (07:43 +0200)
committerGitHub <noreply@github.com>
Wed, 6 Jul 2022 05:43:38 +0000 (07:43 +0200)
site/assets/js/snippets.js
site/content/docs/5.2/forms/checks-radios.md

index 66ef949f7432644550cbf8a8ae51fd51c88fdb84..640ff85c589f7feddaa8724b878e791eb810b2a5 100644 (file)
   // Indeterminate checkbox example in docs and StackBlitz
   document.querySelectorAll('.bd-example-indeterminate [type="checkbox"]')
     .forEach(checkbox => {
-      checkbox.indeterminate = true
+      if (checkbox.id.includes('Indeterminate')) {
+        checkbox.indeterminate = true
+      }
     })
 
   // -------------------------------
index 5c7ab52616ca4c77cfca2fbe4bebe6d07e826488..12f8b00d1c4555eb6d800a94048124ddfc664357 100644 (file)
@@ -49,7 +49,13 @@ Checkboxes can utilize the `:indeterminate` pseudo class when manually set via J
 
 Add the `disabled` attribute and the associated `<label>`s are automatically styled to match with a lighter color to help indicate the input's state.
 
-{{< example >}}
+{{< example class="bd-example-indeterminate" stackblitz_add_js="true" >}}
+<div class="form-check">
+  <input class="form-check-input" type="checkbox" value="" id="flexCheckIndeterminateDisabled" disabled>
+  <label class="form-check-label" for="flexCheckIndeterminateDisabled">
+    Disabled indeterminate checkbox
+  </label>
+</div>
 <div class="form-check">
   <input class="form-check-input" type="checkbox" value="" id="flexCheckDisabled" disabled>
   <label class="form-check-label" for="flexCheckDisabled">