Open yogeshpacheria opened 3 years ago
I have noticed the same issue a while ago.
It seems to happen because the owner document of a node inside a document fragment is the external document. And within the offset helper code, if the node is not contained in its owner document, the calculation returns an object will all zeroes.
Any possibility for this to be fixed?
Dom Helpers does not seem to working properly inside Web Component shadow dom. I am trying to use
offset
method to get the offset of an element.Ideally it should return top: 100px but it is returning
However,
getComputedStyle
returns correct position values.I have create a codepen here for this scenario https://codepen.io/yamraaaj/pen/BaZdPKm. I suspect other utils might not be working inside Shadow DOM as well.