Skip to content

Commit

Permalink
fix(material/form-field): allow clicking on floating label
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalerba committed Nov 28, 2022
1 parent 7d60159 commit b3c3797
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b3c3797

Please sign in to comment.