Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report] Drawer drawer component cannot be shut down by ESC #16954

Closed
bei123wang opened this issue Aug 8, 2019 · 3 comments
Closed

[Bug Report] Drawer drawer component cannot be shut down by ESC #16954

bei123wang opened this issue Aug 8, 2019 · 3 comments

Comments

@bei123wang
Copy link

Element UI version

2.11.1

OS/Browsers version

win10/chrome

Vue version

2.6.10

Reproduction Link

https://codepen.io/bei123wang/pen/YmaJmx?&editable=true

Steps to reproduce

鼠标点击 点我打开按钮 need repro -> 按 esc关闭

What is Expected?

close-on-press-escape 为 true
按 esc 能关闭抽屉

What is actually happening?

close-on-press-escape 为 false
按 esc 只能关闭遮罩层

@element-bot element-bot changed the title [Bug Report] Drawer抽屉组件按esc无法关闭 [Bug Report] Drawer drawer component cannot be shut down by ESC Aug 8, 2019
@element-bot
Copy link
Member

Translation of this issue:

Element UI version

2.11.1

OS/Browsers version

Win10/chrome

Vue version

2.6.10

Reproduction Link

Https://codepen.io/bei123wang/pen/YmaJmx?&editable=true

Steps to reproduce

Click on the mouse to open the button need Repro - > Press ESC to close

What is Expected?

Close-on-press-escape is true

Press ESC to close drawers

What is actually happening?

Close-on-press-escape is false
Press ESC to close the mask layer only

@bei123wang
Copy link
Author

先这样解决了,在 created() 里面给Drawer 组件绑定 handleClose 函数
created() {
let _this = this
this.$nextTick( => {
if (!_this.$refs.acountDrawer.handleClose) {
_this.$refs.acountDrawer.handleClose = function() {
_this.$refs.acountDrawer.closeDrawer()
}
}
})
},

@ziyoung
Copy link
Contributor

ziyoung commented Sep 3, 2019

#16953

@ziyoung ziyoung closed this as completed Sep 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants