Skip to content

使用抽屉(Drawer)初次渲染时候会出现画面偏移情况,可在官方样例中复现 #3703

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

Closed
1 task
happyplum opened this issue Feb 23, 2021 · 8 comments
Assignees

Comments

@happyplum
Copy link

happyplum commented Feb 23, 2021

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

2.0.0

Environment

Google Chrome(88)/Edge(88)x64

https://2x.antdv.com/components/drawer-cn

Steps to reproduce

找到样例"渲染在当前 DOM"
点击open即可重现

What is expected?

左侧画面不变动,弹出右侧抽屉

What is actually happening?

第一次显示抽屉时左侧画面会出现抽屉宽度(width)的偏移,隐藏后再次打开恢复正常显示.可使用f5刷新重现

@happyplum
Copy link
Author

我尝试了下,在火狐中不会出现左侧偏移的情况,但是每次打开抽屉右侧中的字体会出现上下抖动

@github-actions
Copy link

Hello @happyplum. We totally like your proposal/feedback, welcome to send us a Pull Request for it. Please send your Pull Request to proper branch, fill the Pull Request Template here, provide changelog/TypeScript/documentation/test cases if needed and make sure CI passed, we will review it soon. We appreciate your effort in advance and looking forward to your contribution!

你好 @happyplum,我们完全同意你的提议/反馈,欢迎直接在此仓库创建一个 Pull Request 来解决这个问题。请将 Pull Request 发到正确的分支,务必填写 Pull Request 内的预设模板,提供改动所需相应的 changelog、TypeScript 定义、测试用例、文档等,并确保 CI 通过,我们会尽快进行 Review,提前感谢和期待您的贡献。

@ajuner
Copy link
Member

ajuner commented Feb 23, 2021

我看看是案例的问题还是组件的问题。。

@ajuner
Copy link
Member

ajuner commented Feb 23, 2021

Drawer组件在placement设置为right时部分浏览器复现
overflow不设置为hidden的话不会有这个问题。。具体的没定位到。。

@happyplum
Copy link
Author

happyplum commented Feb 23, 2021

Drawer组件在placement设置为right时部分浏览器复现
overflow不设置为hidden的话不会有这个问题。。具体的没定位到。。

我尝试了下默认把父元素的width设置成100%,然后通过pointer-events:none穿透去触发事件,不会触发这个问题.
应该是和width初次变化有关
我现在解决方案是默认visible为true,在onMount的时候再把它设置为false就没问题了

@ajuner
Copy link
Member

ajuner commented Mar 9, 2021

文档临时修复了 会抽时间把drawer组件重构一下解决这个问题

@ajuner ajuner closed this as completed Mar 9, 2021
@zhuxianglong
Copy link

@ajuner 这个问题修复了吗

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants