There’s default reserved space for mat-form to display error , hint text etc, you can turn it off, here’re two ways to do this.
Turn it off explicitly
::ng-deep .mat-mdc-form-field-subscript-wrapper {
display: none;
}
Make it dynamically
@NgModule({
providers: [
{ provide: MAT_FORM_FIELD_DEFAULT_OPTIONS, useValue: { subscriptSizing: 'dynamic' } }
]
})
Reference:
- https://github.com/angular/components/issues/24980
- https://material.angular.io/components/form-field/api#MatFormField