Skip to content

Commit

Permalink
fix(material/datepicker): height issue with large custom header
Browse files Browse the repository at this point in the history
Fixes a bug in the Angular Material `datepicker` component when the sum of the header height and the content is not 354px. This is because we have a predefined height value, but we should use auto value to fit the content.

Fixes angular#20459
  • Loading branch information
Dmitry Kovganov authored and DmitryKovganov committed Sep 2, 2020
1 parent 98d4799 commit e387a7e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/material/datepicker/datepicker-content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ $mat-datepicker-calendar-padding: 8px;
$mat-datepicker-non-touch-calendar-cell-size: 40px;
$mat-datepicker-non-touch-calendar-width:
$mat-datepicker-non-touch-calendar-cell-size * 7 + $mat-datepicker-calendar-padding * 2;
// Based on the natural height of the calendar in a month with 6 rows of dates
// (largest the calendar will get).
$mat-datepicker-non-touch-calendar-height: 354px;
// Height for all content regardless of the number of weeks in a month and the height of the header.
$mat-datepicker-non-touch-calendar-height: auto;

// Ideally the calendar would have a constant aspect ratio, no matter its size, and we would base
// these measurements off the aspect ratio. Unfortunately, the aspect ratio does change a little as
Expand Down

0 comments on commit e387a7e

Please sign in to comment.