Element UI version
2.15.14
OS/Browsers version
Chrome
Vue version
2.7.16
Reproduction Link
https://codepen.io/pen?&prefill_data_id=20b168f4-c0ab-4736-9ce0-4ff71f13ea05
Steps to reproduce
官网文档可复现,el-input设置textarea,输入限制30,在输入29字符后,回车再删除,这时可以输入超出限制的符号,如中文句号
What is Expected?
输入限制生效,超出限制时不能输入
What is actually happening?
超出限制时依然能输入中文句号
20240628_160230.mp4
1条答案
按热度按时间13z8s7eq1#
测试了下,是 chrome 浏览器(126.0.6478.127)的问题,火狐下不会出现此问题。
使用原生 textarea 配合
maxlength
,根据描述即可复现出此问题。https://blog.kainy.cn/2012/09/in-chromes-fulfilled-textareathe-value-of-maxlength-doesnt-match-with-value-length/