From 06bed9b45af290b05fed9ec003a89af1d3baf6a4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Julien=20D=C3=A9ramond?= Date: Sun, 30 Oct 2022 02:30:59 +0200 Subject: [PATCH] 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 --- scss/forms/_floating-labels.scss | 2 +- .../content/docs/5.2/forms/floating-labels.md | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) 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. -- 2.47.3