【问题标题】:placeholder transparent after uptade to angular material 6.4.7占位符在更新到角度材料 6.4.7 后透明
【发布时间】:2019-03-10 17:54:20
【问题描述】:

在将 Angular Material 从 v6.0.1 更新到 v6.4.7 之后,应用程序的所有 mat-form-fields 都有 .mat-form-field-hide-placeholder 类,基本上添加了以下代码:-webkit-text-fill-color: transparent;

现在所有的占位符都是透明的。

这是我们如何将占位符与 mat-form-field 一起使用的示例

<mat-form-field *ngIf="option">
    <mat-select class="irregularselector"
                [(ngModel)]="selectedOption"
                placeholder="Choose one..."
                (selectionChange)="onSelectedOption()">
        <mat-option *ngFor="let opt of irregularOpts;" value={{opt.uuid}}> 
            {{opt.name}}
        </mat-option>
    </mat-select>
 </mat-form-field>

我们想要在哪里显示上述占位符。

你知道为什么会发生这种情况,或者知道如何避免这个类吗?

【问题讨论】:

    标签: angular angular-material placeholder


    【解决方案1】:

    好的,我发现此行为与默认为旧版的 mat-form-field 的新外观有关。如果我选择标准,那么 mat-form-field-hide-placeholder 类就会消失。

    【讨论】:

      猜你喜欢
      • 2019-08-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-03-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多