首页 > 解决方案 > 当我在 WAVE 扩展结果中为离子输入标签使用 clearInput 属性时,出现空按钮名称错误。有没有人遇到过类似的问题?

问题描述

我正在使用具有 clearInput 属性的离子输入标签。当我为我的网站使用 wave 扩展进行审核时,我收到了空按钮错误。那是因为图标“x”清除输入,因为图标没有名称 wave 显示错误。我该如何解决这个问题?实际代码是:<ion-input id="input-name" formControlName="name" clearInput></ion-input>

结果在浏览器中: <ion-input _ngcontent-qcw-c39="" clearinput="" formcontrolname="name" id="input-name" ng-reflect-clear-input="" ng-reflect-name="name" class="ng-untouched ng-pristine ng-invalid sc-ion-input-md-h sc-ion-input-md-s md hydrated ion-untouched ion-pristine ion-invalid"> <input class="native-input sc-ion-input-md" aria-labelledby="ion-input-8-lbl" autocapitalize="off" autocomplete="off" autocorrect="off" name="ion-input-8"> <button type="button" class="input-clear-icon sc-ion-input-md" tabindex="-1"></button> </ion-input>

标签: angularionic-frameworkionic4

解决方案


离子输入上的属性clearInput采用布尔值 true 或 false。默认情况下,它的值设置为 false。离子输入的示例是 -

<ion-input type="text" [clearInput]="true" placeholder="Enter value"></ion-input>

推荐阅读