Skip to content

Commit 5bcba85

Browse files
mmalerbajelbourn
authored andcommitted
fix(datepicker): make height of calendar constant in non-touch mode (#5694)
1 parent a34787d commit 5bcba85

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/lib/datepicker/datepicker-content.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ $md-datepicker-calendar-padding: 8px;
55
$md-datepicker-non-touch-calendar-cell-size: 40px;
66
$md-datepicker-non-touch-calendar-width:
77
$md-datepicker-non-touch-calendar-cell-size * 7 + $md-datepicker-calendar-padding * 2;
8+
// Based on the natural height of the calendar in a month with 6 rows of dates
9+
// (largest the calendar will get).
10+
$md-datepicker-non-touch-calendar-height: 354px;
811

912
// Ideally the calendar would have a constant aspect ratio, no matter its size, and we would base
1013
// these measurements off the aspect ratio. Unfortunately, the aspect ratio does change a little as
@@ -27,6 +30,7 @@ $md-datepicker-touch-max-height: 788px;
2730

2831
.mat-calendar {
2932
width: $md-datepicker-non-touch-calendar-width;
33+
height: $md-datepicker-non-touch-calendar-height;
3034
}
3135

3236
.mat-datepicker-content-touch {

0 commit comments

Comments
 (0)