dom-align icon indicating copy to clipboard operation
dom-align copied to clipboard

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

Open Yangfan2016 opened this issue 4 years ago • 0 comments

前置条件:

dom 结构如下图

image

实际结果:

image

image

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

image

预期结果:

image

Yangfan2016 avatar Oct 27 '20 09:10 Yangfan2016