From: Julien Déramond Date: Sun, 30 Oct 2022 00:30:59 +0000 (+0200) Subject: Fix disabled floating labels and add some examples of it in the docs (#37299) X-Git-Tag: v5.3.0-alpha1~103 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=06bed9b45af290b05fed9ec003a89af1d3baf6a4;p=thirdparty%2Fbootstrap.git Fix disabled floating labels and add some examples of it in the docs (#37299) * Fix disabled floating labels and add some examples of it in the docs * Add disabled custom height textarea --- diff --git a/scss/forms/_floating-labels.scss b/scss/forms/_floating-labels.scss index 93c1c22051..e5e35d326d 100644 --- a/scss/forms/_floating-labels.scss +++ b/scss/forms/_floating-labels.scss @@ -1,7 +1,7 @@ .form-floating { position: relative; - &::before { + &::before:not(.form-control:disabled) { position: absolute; top: $input-border-width; left: $input-border-width; diff --git a/site/content/docs/5.2/forms/floating-labels.md b/site/content/docs/5.2/forms/floating-labels.md index 9ec4fcd2fa..6b33fb67ba 100644 --- a/site/content/docs/5.2/forms/floating-labels.md +++ b/site/content/docs/5.2/forms/floating-labels.md @@ -75,6 +75,34 @@ Other than `.form-control`, floating labels are only available on `.form-select` {{< /example >}} +## Disabled + +Add the `disabled` boolean attribute on an input, a textarea or a select to give it a grayed out appearance, remove pointer events, and prevent focusing. + +{{< example >}} +
+ + +
+
+ + +
+
+ + +
+
+ + +
+{{< /example >}} + ## Readonly plaintext Floating labels also support `.form-control-plaintext`, which can be helpful for toggling from an editable `` to a plaintext value without affecting the page layout.