I am encountering an issue with an absolutely positioned div that is nested within a statically-positioned parent container. I noticed that when I apply the transform: translateY(-50%)
property to the container, the child element behaves as if it were being treated as position: relative
.
Upon checking the value of
absolutelyPositionedChild.offsetParent
, I observed that it references the container. Additionally, retrieving the value of container.computedStyleMap().get('position')
returns CSSKeywordValue {value: 'static'}
. Despite this confirmation that the position is indeed static, the container is still considered the offsetParent. Only when I disable the transform
property in the dev tools inspector does the offsetParent
change to a higher-level div encompassing the entire application, as intended.
Is there any documentation addressing this behavior or have I misunderstood something? More importantly, is there a method to prevent the container from being recognized as the offsetParent?