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] stepper 当min大于10,input键盘输入值时的表现与小于10时不一致 #5948

Open
nijiong opened this issue Dec 14, 2024 · 1 comment

Comments

@nijiong
Copy link

nijiong commented Dec 14, 2024

重现链接

Vant Weapp 版本

1.11.7

描述一下你遇到的问题。

当min小于10时,input 可以随意删除任何数字并清空数字,然后进行输入,当min大于10时, input 无法删除数字
假设min为50 input 此时为50 ,软键盘数字删除一位就会自动纠正成50 ,无法清空数字,并重新输入

查看代码后发现源码监听了input onInput事件,并实时纠正数字
image

重现步骤

将官网stepper中 "限制输入整数"这个示例,min值调整大小至10以上就可以浮现

设备/浏览器

No response

@nijiong
Copy link
Author

nijiong commented Dec 14, 2024

onInput事件似乎是为了提供一个change事件给用户,但个人感觉用户在输入过程中似乎这个事件并不重要,反而会实时触发纠正数字导致输入功能无法使用(想将50改为53的话,只能用过+-按钮无法通过input输入了,或者输入503再将0删除),是否可以考虑再做一个配置项或者什么的

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

1 participant