Angular material datepicker does't arrange items on a single row


In my web application I’m using an angular material datepicker.
The issue is that it does not show all the elements in a row.
This is my view:


To avoid that my customized css has an impact on the view I removed every customized style.

This way, my html is very simple. I simply copied and pasted the angular material example from angular official portal (basic datepicker item):

<mat-form-field appearance="fill">
  <mat-label>Choose a date</mat-label>
  <input matInput [matDatepicker]="picker">
  <mat-datepicker-toggle matIconSuffix [for]="picker"></mat-datepicker-toggle>
  <mat-datepicker #picker></mat-datepicker>

But according to the angular material exaple on-line the image should be something like this:
Basi datepicker from angular material online help

In what am I wrong?


Try using matSuffix instead of matIconSuffix in your mat-datepicker-toggle.

Edit following @TotallyNewb’s comment.

Angular version <= v14: matSuffix

Angular version >= v15: matIconSuffix

Answered By – Nico

Answer Checked By – Marilyn (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.