Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report] field组件,设置maxlength,在ios环境中,当输入位数超过maxlength,无法触发onchange事件。 #13121

Open
ling317 opened this issue Sep 18, 2024 · 4 comments

Comments

@ling317
Copy link

ling317 commented Sep 18, 2024

重现链接

https://wddlkg-8080.csb.app/

Vant 版本

4.8.2

描述一下你遇到的问题。

field组件,设置maxlength,在ios环境中,当输入位数超过maxlength,无法触发onchange事件。只能小于等于maxlength,才可触发。

重现步骤

1,输入手机号18612341234,可以正常触发onchange
2. 输入手机号1861234123456 ,就不会触发onchange
3. 只在ios环境有这个问题。

设备/浏览器

ios

@ling317 ling317 changed the title [Bug Report] 请在此填写标题 [Bug Report] field组件,设置maxlength,在ios环境中,当输入位数超过maxlength,无法触发onchange事件。 Sep 18, 2024
@ling317
Copy link
Author

ling317 commented Sep 18, 2024

重现链接 https://wddlkg-8080.csb.app/

@inottn
Copy link
Collaborator

inottn commented Sep 18, 2024

兼容性问题,目前想不到怎么解决 🤔

@ling317
Copy link
Author

ling317 commented Sep 19, 2024

兼容性问题,目前想不到怎么解决 🤔

使用原生的input能正常触发onchange,根据示例代码块 https://wddlkg-8080.csb.app/ 之前的vant2也是正常的

@inottn
Copy link
Collaborator

inottn commented Sep 19, 2024

兼容性问题,目前想不到怎么解决 🤔

使用原生的input能正常触发onchange,根据示例代码块 https://wddlkg-8080.csb.app/ 之前的vant2也是正常的

是的,后面 maxlength 没有用原生的实现

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants