diff --git a/.changeset/beige-planets-buy.md b/.changeset/beige-planets-buy.md new file mode 100644 index 0000000000..9a0202666f --- /dev/null +++ b/.changeset/beige-planets-buy.md @@ -0,0 +1,5 @@ +--- +'@lion/ui': patch +--- + +improve deep-contains function so it works correctly with slots diff --git a/packages/ui/components/overlays/test/utils-tests/deep-contains.test.js b/packages/ui/components/overlays/test/utils-tests/deep-contains.test.js index d6e6307234..bceab880ca 100644 --- a/packages/ui/components/overlays/test/utils-tests/deep-contains.test.js +++ b/packages/ui/components/overlays/test/utils-tests/deep-contains.test.js @@ -124,4 +124,31 @@ describe('deepContains()', () => { expect(deepContains(element, elementFirstChildShadowChildShadow)).to.be.true; expect(deepContains(element, elementFirstChildShadowChildShadowLastChild)).to.be.true; }); + + it('returns true if the element, which is located in ShadowsRoot, contains a target element, located in the LightDom', async () => { + const mainElement = /** @type {HTMLElement} */ (await fixture('
')); + mainElement.innerHTML = ` +