【发布时间】:2020-02-08 21:30:24
【问题描述】:
我有一个带有mat-form-field 输入的普通表单。表单包含一个日期字段和一个小时字段。这些字段在 chrome 中看起来不错:
但是,在 Firefox 和 Microsoft Edge 中,一个字段的高度比另一个字段高:
我不确定是什么原因导致了这种情况,尤其是我的组件没有对输入实现任何特殊样式。我只是在使用Flex Layout
<!-- Date and Time Start -->
<div fxFlex
fxLayout.lt-sm="column"
fxLayoutGap="2%"
fxLayoutAlign.gt-sm="space-around stretch"
fxLayout="row">
<!-- Date Start -->
<mat-form-field appearance="fill"
fxFlex
color="accent">
<input id="inputDateStart"
matInput
[formControl]="startDate"
(dateChange)="startDateChanged($event.value)"
[matDatepicker]="pickerStart"
[max]="startDatePickerMax"
placeholder="ab">
<mat-error>{{ getErrorMsgForDate() }}</mat-error>
<mat-datepicker-toggle matSuffix
[for]="pickerStart"></mat-datepicker-toggle>
<mat-datepicker #pickerStart></mat-datepicker>
<mat-hint>Ab Aufnahmedatum</mat-hint>
</mat-form-field>
<!-- Time Start -->
<app-w-mat-timepicker color="accent"
id="timePickerStart"
placeholder="von"
[timeFormat]="24"
[(userTime)]="startTimeToFilterFor"
(userTimeChange)="startTimeChanged($event)"></app-w-mat-timepicker>
</div>
还有我的时钟组件
<div fxFlex
fxLayout="row">
<mat-form-field fxFlex
appearance="fill"
color="accent">
<input matInput
[placeholder]="placeholder"
[value]="time">
<mat-hint>Uhrzeit</mat-hint>
<mat-icon matSuffix
(click)="showPicker($event)"
svgIcon="clock"></mat-icon>
</mat-form-field>
</div>
【问题讨论】:
标签: css angular angular-material angular-flex-layout