-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
input problem with trim modifier #4951
Comments
你提供的 Reproduction 中,输入 " aaaa " 已经是被 trim 为 "aaaa",这应该就是预期行为了吧 如果你想输入框中显示的是 " aaaa " 但实际值是 "aaaa" 这个就跟 v-model 提供的作用有偏差了,不知道你的疑问在哪 |
就是希望能像原生input的v-model.trim一样不是在input事件的时候就触发trim,而是失焦的change事件时进行trim。这样就不会中断用户的输入导致用户很难输入中间带空格比如"a b"这样的字符串 |
可以用 blur 事件满足该场景 |
下个版本会支持 lazy,然后可以 |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Version
3.0.0-alpha.13
Environment
vue3.2.16, chrome 95.0.4638.69,macos12.0.1
Reproduction link
Steps to reproduce
1.给input设置trim修饰符(v-model:value.trim="value")
2.输入任意字符(包括空格),比如" aaaa "
What is expected?
可以正常输入" aaaa ",并且绑定的value值也被trim为"aaaa"
What is actually happening?
无法输入空格
The text was updated successfully, but these errors were encountered: