This repository was archived by the owner on Nov 4, 2025. It is now read-only.

Description
function onResize([{ target }]: ResizeObserverEntry[]) {
if (!document.documentElement.contains(target)) return; // <-- always return false when in ShadowDOM
const { width, height } = target.getBoundingClientRect();
const fixedWidth = Math.floor(width);
const fixedHeight = Math.floor(height);
https://github.com/react-component/align/blob/master/src/util.ts#L36C5-L36C60
I cannot let the dropdown popup attach outside the ShadowRoot because of style conflicts. Need to add a judgement about whether the target element is in a ShadowRoot which belongs to the currentDocument.