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

[Drawer]destroyOnClose属性设为true,抽屉呼出时console报错"TypeError: Cannot read properties of undefined (reading 'focus')" #504

Closed
dreamsqin opened this issue Mar 6, 2022 · 2 comments · Fixed by #509
Labels
🐞 bug Something isn't working to be published fixed, not be published

Comments

@dreamsqin
Copy link
Contributor

重现链接

https://codesandbox.io/s/tdesign-vue-demo-forked-jw55ky?file=/src/demo.vue

重现步骤

destroyOnClose属性设为true,打开抽屉

期望结果

console不报错

实际结果

console报错"TypeError: Cannot read properties of undefined (reading 'focus')"

补充说明

visible的watcher中应做判断后调用focus:应修改为(this.$refs.drawerContainer as HTMLDivElement)?.focus?.();
image

Environment Info
相关版本 0.35.1
框架版本 / 基础库版本 Vue(2.6.14)
系统、浏览器 MacOS(10.15.7)、Chrome(98.0.4758.80)
Node版本 12.22.2
@uyarn uyarn added the 🐞 bug Something isn't working label Mar 7, 2022
@uyarn uyarn added the to be published fixed, not be published label Mar 7, 2022
@uyarn
Copy link
Collaborator

uyarn commented Mar 7, 2022

I see

@xiaosansiji
Copy link
Collaborator

已在 0.36.0 版本中修复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working to be published fixed, not be published
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants