aboutsummaryrefslogtreecommitdiff
path: root/site
diff options
context:
space:
mode:
authorNikita Mikhaylov <[email protected]>2020-09-29 21:49:50 +0300
committerGitHub <[email protected]>2020-09-29 21:49:50 +0300
commit0cb880c7fbd93d262a29e4660975d5c8cc0b9676 (patch)
treeb7f190ccfc248facd7ca5636f05116f5f5ed52a7 /site
parent319954d369a09c1bca1fc1721f6977e3a7b1d86d (diff)
downloadbootstrap-0cb880c7fbd93d262a29e4660975d5c8cc0b9676.tar.xz
bootstrap-0cb880c7fbd93d262a29e4660975d5c8cc0b9676.zip
Fix disabled checkbox toggle buttons (#31651)
* fix disabled checkbox toggle buttons * add disabled checks-radios examples in documentation Co-authored-by: XhmikosR <[email protected]>
Diffstat (limited to 'site')
-rw-r--r--site/content/docs/5.0/forms/checks-radios.md12
1 files changed, 10 insertions, 2 deletions
diff --git a/site/content/docs/5.0/forms/checks-radios.md b/site/content/docs/5.0/forms/checks-radios.md
index b6914ee42..ae89f5ee3 100644
--- a/site/content/docs/5.0/forms/checks-radios.md
+++ b/site/content/docs/5.0/forms/checks-radios.md
@@ -227,6 +227,11 @@ Create button-like checkboxes and radio buttons by using `.btn` styles rather th
<label class="btn btn-primary" for="btn-check-2">Checked</label>
{{< /example >}}
+{{< example >}}
+<input type="checkbox" class="btn-check" id="btn-check-3" autocomplete="off" disabled>
+<label class="btn btn-primary" for="btn-check-3">Disabled</label>
+{{< /example >}}
+
{{< callout info >}}
Visually, these checkbox toggle buttons are identical to the [button plugin toggle buttons]({{< docsref "/components/buttons#button-plugin" >}}). However, they are conveyed differently by assistive technologies: the checkbox toggles will be announced by screen readers as "checked"/"not checked" (since, despite their appearance, they are fundamentally still checkboxes), whereas the button plugin toggle buttons will be announced as "button"/"button pressed". The choice between these two approaches will depend on the type of toggle you are creating, and whether or not the toggle will make sense to users when announced as a checkbox or as an actual button.
{{< /callout >}}
@@ -240,8 +245,11 @@ Visually, these checkbox toggle buttons are identical to the [button plugin togg
<input type="radio" class="btn-check" name="options" id="option2" autocomplete="off">
<label class="btn btn-secondary" for="option2">Radio</label>
-<input type="radio" class="btn-check" name="options" id="option3" autocomplete="off">
-<label class="btn btn-secondary" for="option3">Radio</label>
+<input type="radio" class="btn-check" name="options" id="option3" autocomplete="off" disabled>
+<label class="btn btn-secondary" for="option3">Disabled</label>
+
+<input type="radio" class="btn-check" name="options" id="option4" autocomplete="off">
+<label class="btn btn-secondary" for="option4">Radio</label>
{{< /example >}}
### Outlined styles