角材料(任何版本)标签或占位符不浮动

时间:2020-06-01 14:30:02

标签: javascript angular angular-material

很长一段时间以来,我都面临着真正令人讨厌的问题。

我已将我的角度从版本6升级到最新版本(当前是9.1.3,主要内容是9.2.1)。

问题是: 标签和/或占位符不是浮动的。只有当我在ng服务后第一次在浏览器中打开应用程序时,才会发生这种情况。当我刷新浏览器选项卡时,该错误消失。 not floating placeholder bug

代码如下:

<div class="field__wrapper">
  <p>Location</p>
  <mat-form-field class="form__field">
      <input
        matInput
        type="text"
        placeholder="E.g. Santorini, Greece"
        formControlName="location"
        maxlength="60">
    <mat-error *ngIf="newEventForm.controls['location'].touched && !newEventForm.controls['location'].dirty">
      Location is <strong>required</strong>
    </mat-error>
  </mat-form-field>
</div>

0 个答案:

没有答案