ElemeFE / element

A Vue.js 2.0 UI Toolkit for Web
https://element.eleme.io/
MIT License
54.1k stars 14.64k forks source link

[Bug Report] el-dialog repeatedly trigger the click event #20820

Open jiawenDragon opened 3 years ago

jiawenDragon commented 3 years ago

Element UI version

2.15.1

OS/Browsers version

win10/chrome 88.0.4324.190

Vue version

2.6.12

Reproduction Link

https://jsfiddle.net/59wju1yv/3/

Steps to reproduce

通过el-button的click方法打开el-dialog后不关闭dialog的情况下,按下回车键

What is Expected?

不会触发button的click事件

What is actually happening?

会触发el-button的click事件(button没有监听回车事件),导致click方法重复调用。

element-bot commented 3 years ago

Translation of this issue:

Element UI version

2.15.1

OS/Browsers version

win10/chrome 88.0.4324.190

Vue version

2.6.12

Reproduction Link

https://jsfiddle.net/59wju1yv/3/

Steps to reproduce

Open El dialog through the click method of El button and press enter without closing the dialog

What is Expected?

The button's click event will not be triggered

What is actually happening?

The click event of El button will be triggered (button does not listen for the carriage return event), resulting in repeated call of the click method.