ElemeFE / element

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

[bug report] El toolip: when the click event triggers confirm, there is a focus problem after confirm completes processing, and toolip will appear on its own. #19301

Open chenxch opened 4 years ago

chenxch commented 4 years ago

Element UI version

2.13.1

OS/Browsers version

win10/chrome79.0.3945.79

Vue version

2.6.11

Reproduction Link

https://codepen.io/chenxch/pen/ExVvjob

Steps to reproduce

1、点击tooltip包裹的按钮 2、处理弹出框,取消或者确定 3、按钮的tooltip就自动出现了

What is Expected?

confirm处理后,tooltip不要自动focus当初提示

What is actually happening?

confirm处理后,tooltip自动focus了

element-bot commented 4 years ago

Translation of this issue:

Element UI version

2.13.1

OS/Browsers version

win10/chrome79.0.3945.79

Vue version

2.6.11

Reproduction Link

https://codepen.io/chenxch/pen/ExVvjob

Steps to reproduce

  1. Click the button of tooltip package

  2. Process pop-up, cancel or OK

  3. The button's tooltip appears automatically

What is Expected?

After confirm processing, the tool IP does not automatically focus on the original prompt

What is actually happening?

After confirm processing, toolip automatically focuses

migueling commented 4 years ago

Because the MessageBox returns focus to the last active element when closed, a workaround for me was to call document.activeElement.blur() before this.$confirm() to change focus from button to body.

chenxch commented 4 years ago

@migueling thk.

5265liu commented 4 years ago

thanks for your answer, but i think this is a bug

migueling commented 4 years ago

thanks for your answer, but i think this is a bug

Yes, I also think it's a bug, what I commented was just a workaround that I used.

chenxch commented 4 years ago

I hope the element UI team can fix this problem.

Huawanjiu commented 3 years ago

Because the MessageBox returns focus to the last active element when closed, a workaround for me was to call document.activeElement.blur() before this.$confirm() to change focus from button to body.

thanks, this works for me, call blur method on el-tooltip element before this.$confirm().