3lang3 / react-vant

React mobile UI Components base on Vant
https://react-vant.3lang.dev
MIT License
1.32k stars 189 forks source link

🐛 [Bug]: 输入框input字数限制,输入最后几个字符的时候,无法输入中文 #628

Closed githubhwen closed 1 year ago

githubhwen commented 1 year ago

Which React Vant packages are impacted?

What version of React Vant are you using?

1.0.0-beta.38

Reproduce live demo(codesandebox or stackblitz)?

No response

Descripition

该bug在官网可复现,限制10个字符的输入框,输入9个中文后,最后一个文字在打中文的时候,输入不了 https://react-vant.3lang.dev/components/input#props

3lang3 commented 1 year ago

是因为中文会占两个字符

luo3house commented 1 year ago

should be a bug https://developer.mozilla.org/en-US/docs/web/html/attributes/maxlength