From b3c3797b17a6e4bb948365b65177bd2030ae4088 Mon Sep 17 00:00:00 2001 From: Miles Malerba Date: Mon, 28 Nov 2022 23:20:28 +0000 Subject: [PATCH] fix(material/form-field): allow clicking on floating label --- .../form-field/_mdc-text-field-structure-overrides.scss | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/material/form-field/_mdc-text-field-structure-overrides.scss b/src/material/form-field/_mdc-text-field-structure-overrides.scss index ddab16d1b24b..a0d630cf5281 100644 --- a/src/material/form-field/_mdc-text-field-structure-overrides.scss +++ b/src/material/form-field/_mdc-text-field-structure-overrides.scss @@ -20,11 +20,14 @@ border: none; } - // In order to ensure proper alignment of the floating label, we reset its line-height. - // The line-height is not important as the element is absolutely positioned and only has one line - // of text. .mat-mdc-form-field .mat-mdc-floating-label.mdc-floating-label { + // In order to ensure proper alignment of the floating label, we reset its line-height. + // The line-height is not important as the element is absolutely positioned and only has one + // line of text. line-height: normal; + // This makes migration from the legacy form-field easier for tests that were depending on + // clicking the label to focus the input. + pointer-events: all; } // Reset the height that MDC sets on native input elements. We cannot rely on their