Skip to content

Commit 0971e39

Browse files
committed
fix(material/datepicker): unable to click datepicker toggle when form field is disabled (#25863)
We support the case where the form field is disabled, but the datepicker isn't. Currently this is broken, because MDC sets `pointer-events: none` on the entire form field when it is disabled. These changes add `pointer-events: auto` only on the toggle to enable clicking. (cherry picked from commit fe44107)
1 parent 5a3eb94 commit 0971e39

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/material/datepicker/datepicker-toggle.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
@use '@angular/cdk';
22

3+
// We support the case where the form field is disabled, but the datepicker is not.
4+
// MDC sets `pointer-events: none` on disabled form fields which prevents clicks on the toggle.
5+
.mat-datepicker-toggle {
6+
pointer-events: auto;
7+
}
8+
39
@include cdk.high-contrast(active, off) {
410
.mat-datepicker-toggle-default-icon {
511
// On Chromium-based browsers the icon doesn't appear to inherit the text color in high

0 commit comments

Comments
 (0)