Element UI version
2.13.2
OS/Browsers version
WIN10 / chrome浏览器 版本 80.0.3987.122(正式版本) (64 位)
Vue version
3.0.0-beta.14
Reproduction Link
https://codepen.io/pen/?&editable=true=https%3A%2F%2Felement.eleme.io%2F%3F
Steps to reproduce
https://element.eleme.cn/#/zh-CN/component/form
数字类型验证,在线运行,聚焦到input框后,直接使用键盘的enter即可复现,没有自定义enter事件,却触发了enter事件
What is Expected?
不触发默认的enter事件
What is actually happening?
触发了默认的enter事件
4条答案
按热度按时间wpx232ag1#
W3C 标准中有如下规定:当一个 form 元素中只有一个输入框时,在该输入框中按下回车应提交该表单。
具体可以看https://element.eleme.cn/?#/zh-CN/component/form
bgtovc5b2#
如果想规避默认行为,可以另加一个输入框。
disho6za3#
如果有多个输入框,但是希望保留这个 onEnter 效果,应该怎么写
r7s23pms4#
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.