[Bug Report] Picker cannot hide smartly / 日期选择窗隐藏机制问题
- Dominant language
- Vue
- Stars
- 54k
- Forks
- 14.4k
- PR merge metrics
- No merged PRs in 30d
Description
### Element UI version
2.13.2
### OS/Browsers version
chrome
### Vue version
3.0.0-beta.16
### Reproduction Link
https://codepen.io/mistorfu/pen/zYrEyJw
### Steps to reproduce
1. focus in datetime picker, the picker panel will be show. 聚焦在日期输入框,日期选择窗出现。
2. focus in normal input, the picker panel will be hidden. 聚焦改为普通的input框,日期选择窗自动隐藏,行为正确。
3. focus in datetime picker again, picker panel will be show. 重新聚焦在日期输入框,日期选择窗出现。
4. focus in tree select, the picker will not be hidden. 聚焦在tree select组件上,日期选择框不自动隐藏。
### What is Expected?
if document's active element is not in datetime picker, hide the picker. 如果整个页面的焦点不在组件的元素上,自动隐藏日期选择窗。
### What is actually happening?
Picker hide depends on the mouse click event. If the mouse event stop Propagation, the picker cannot auto hide.
目前隐藏日期选择窗的行为依赖于鼠标点击事件,但是如果鼠标点击事件被阻止冒泡的话,就不能自动隐藏了。这样不好,组件使用者需要额外的代码来控制日期选择框的隐藏。
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.