输入元素的类型('email')不支持选择,Ionic v6

The input element's type ('email') does not support selection, Ionic v6

我有这个错误,一旦我的离子输入发生变化就会触发。

我可以使用 'text' 更改类型来解决问题,但自动完成电子邮件无法正常工作。

感谢您的回答!

错误:

index-06cd27b1.js:1986 DOMException: Failed to execute 'setSelectionRange' on 'HTMLInputElement': The input element's type ('email') does not support selection.
    at Input.valueChanged (http://localhost:4200/node_modules_ionic_core_dist_esm_ion-input_entry_js.js:236:24)

代码:

     <ion-item>
            <ion-label position="floating">
              <ion-icon name="mail-outline"></ion-icon>
              Your email</ion-label
            >
            <ion-input
              type="email"
              autocomplete="email"
              placeholder="my-mail@gmail.com"
              [formControlName]="'email'"
            >
            </ion-input>
          </ion-item>

版本: "@ionic/angular": "6.0.7", Angular : "^13.1.4"

我从今天开始遇到同样的问题:@ionic/angular@6.0.2,Angular@13.2.2。

这是一个已知的bug,你可以查看issuehere。正如线程中所述,在 6.0.8 发布之前,您可以将包的开发版本用作临时修复。它非常适合我。

@ionic/angular@6.0.8-dev.1644430127.1b9bb92