1

When i tried to open angular material datepicker it was opening upside of an input field. How to make it to open downside of an input field.

<mat-form-field appearance="outline" class="w-100 date-class">
          <mat-label class="required">End Date</mat-label>
          <input
            matInput
            [matDatepicker]="picker2"
            (dateChange)="onEndDateChange($event)"
            [min]="todayDate"
            formControlName="toDate"
            readonly
          />
          <mat-datepicker-toggle matPrefix [for]="picker2"></mat-datepicker-toggle>
          <mat-datepicker #picker2 yPosition="below"></mat-datepicker>
</mat-form-field>

1 Answers1

1

If you want to control where the drop will be places you couls use parameters like: DatepickerDropdownPositionX, DatepickerDropdownPositionY (https://material.angular.io/components/datepicker/api)

type DatepickerDropdownPositionY = 'above' | 'below';
Zsolt Balint
  • 767
  • 1
  • 6