vant-weapp icon indicating copy to clipboard operation
vant-weapp copied to clipboard

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

Open vcc0827 opened this issue 1 year ago • 1 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设备上可以复现

vcc0827 avatar Jun 25 '24 14:06 vcc0827

未能复现,如能复现需要提供一下设备信息以及小程序代码片段

landluck avatar Oct 14 '24 02:10 landluck