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

当 position (非 static属性) 和 overflow (非 visible属性)不在 同一个元素上时,可视区域 计算会遗漏 #57

Open
Yangfan2016 opened this issue Oct 27, 2020 · 1 comment

Comments

@Yangfan2016
Copy link

前置条件:

dom 结构如下图

image

实际结果:

image

image

sourceNode 获取到的 offsetParent 是 上图中 ”position:fixed“ 的元素,这样的话,就直接跳过了 ”overflow:auto“ 的元素参与 可视区域计算的过程,又因为 ”position:fixed“ 的元素 的overflow 属性 为 "visible" ,他之上的元素一直到 body都是 ”visible“ 属性,导致最终的可视区域 就变为了 body

image

预期结果:

image

@qinbinhua601
Copy link

遇到同样问题了,请问最后有办法解决吗?

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

2 participants