youzan / vant-weapp

轻量、可靠的小程序 UI 组件库

Home Page:https://vant.pro/vant-weapp/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug Report] van-field bindinput事件在ios端,只进行一次输入却被多次触发

vcc0827 opened this issue · comments

重现链接

// wxml代码
 <van-field
        model:value="{{verificationCode}}"
        label="验证码"
        placeholder="输入验证码"
        maxlength="6"
        bindinput="onInput"
        id="inputId"
        focus="{{isFocus}}"
        type="number"
 ></van-field>
// js代码
onInput(e) {
      const code = e.detail;
      this.setData({
        verificationCode: code
      });
      if (code.length === 6) {
        this.goProcess();
      }
    }

Vant Weapp 版本

1.7.2

描述一下你遇到的问题。

当用户使用ios系统的手机时,通过剪贴板自动粘贴验证码,会重复调用this.goProcess();
预期的逻辑是,当输入的code是6位长度时,调用this.goProcess();
且一次输入应该对应一次输出,而不是多次。
这个问题仅在ios端出现,模拟器、安卓设备都是正常的。

重现步骤

使用ios系统往输入框中粘贴6位数字即可复现

设备/浏览器

ios设备上可以复现