Skip to content

Commit

Permalink
fix(material/datepicker): unable to click datepicker toggle when form…
Browse files Browse the repository at this point in the history
… 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)
  • Loading branch information
crisbeto committed Oct 26, 2022
1 parent 5a3eb94 commit 0971e39
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/material/datepicker/datepicker-toggle.scss
@@ -1,5 +1,11 @@
@use '@angular/cdk';

// We support the case where the form field is disabled, but the datepicker is not.
// MDC sets `pointer-events: none` on disabled form fields which prevents clicks on the toggle.
.mat-datepicker-toggle {
pointer-events: auto;
}

@include cdk.high-contrast(active, off) {
.mat-datepicker-toggle-default-icon {
// On Chromium-based browsers the icon doesn't appear to inherit the text color in high
Expand Down

0 comments on commit 0971e39

Please sign in to comment.