From ca4ee0f91e8fcc1b8a8cd0fe8498b970fc41aecc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 5 Sep 2025 07:44:09 +0000 Subject: [PATCH 01/14] Initial plan From 76f55b2d1edfae0c4f7ba2172b23cda7a4fbeadd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 5 Sep 2025 07:51:00 +0000 Subject: [PATCH 02/14] Initial analysis of popover scroll parent issue Co-authored-by: iOvergaard <752371+iOvergaard@users.noreply.github.com> --- lerna.json | 1 - 1 file changed, 1 deletion(-) diff --git a/lerna.json b/lerna.json index cbc0428d4..64f532548 100644 --- a/lerna.json +++ b/lerna.json @@ -6,7 +6,6 @@ "exact": true, "noPush": true, "npmClient": "npm", - "useWorkspaces": true, "includeMergedTags": true, "conventionalCommits": true, "forcePublish": true, From 6b215960ca2df73b4729651e4aa9bdcc811214b4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 5 Sep 2025 07:56:37 +0000 Subject: [PATCH 03/14] Fix scroll parent detection in shadow DOM containers - Clear scroll parents array before repopulating to prevent duplicates - Add shadow DOM traversal support to old popover element - Enhanced both uui-popover and uui-popover-container components Co-authored-by: iOvergaard <752371+iOvergaard@users.noreply.github.com> --- .../lib/uui-popover-container.element.ts | 3 + .../lib/uui-popover-container.test.ts | 74 ++++++++++ .../uui-popover/lib/uui-popover.element.ts | 19 ++- test-shadow-dom-scroll.html | 126 ++++++++++++++++++ 4 files changed, 220 insertions(+), 2 deletions(-) create mode 100644 test-shadow-dom-scroll.html diff --git a/packages/uui-popover-container/lib/uui-popover-container.element.ts b/packages/uui-popover-container/lib/uui-popover-container.element.ts index 4c8590261..d80348c01 100644 --- a/packages/uui-popover-container/lib/uui-popover-container.element.ts +++ b/packages/uui-popover-container/lib/uui-popover-container.element.ts @@ -343,6 +343,9 @@ export class UUIPopoverContainerElement extends LitElement { #getScrollParents(): any { if (!this.#targetElement) return; + // Clear previous scroll parents to avoid duplicates + this.#scrollParents = []; + let style = getComputedStyle(this.#targetElement); if (style.position === 'fixed') { return; diff --git a/packages/uui-popover-container/lib/uui-popover-container.test.ts b/packages/uui-popover-container/lib/uui-popover-container.test.ts index a2ad641c8..13168c0f1 100644 --- a/packages/uui-popover-container/lib/uui-popover-container.test.ts +++ b/packages/uui-popover-container/lib/uui-popover-container.test.ts @@ -1,5 +1,6 @@ import { html, fixture, expect } from '@open-wc/testing'; import { UUIPopoverContainerElement } from './uui-popover-container.element'; +import '@umbraco-ui/uui-button/lib'; describe('UUIPopoverContainerElement', () => { let element: UUIPopoverContainerElement; @@ -24,4 +25,77 @@ describe('UUIPopoverContainerElement', () => { await element.updateComplete; expect(element).to.have.attribute('popover'); }); + + describe('scroll parent detection', () => { + it('should properly detect scroll parents in nested shadow DOM containers', async () => { + // Create a test structure with nested shadow DOM and scroll containers + const testContainer = await fixture(html` +
+ The button is inside a shadow DOM with nested scroll containers. The + popover should follow when scrolling either container. +
+ ++ This test demonstrates the fix for popover scroll parent detection in + shadow DOM with nested scroll containers. +
+ +This is a regular DOM setup for comparison:
+ ++ This popover is in regular DOM (not shadow DOM) and should also work + correctly. +
+This popover should track scrolling in both containers
+- This test demonstrates the fix for popover scroll parent detection in - shadow DOM with nested scroll containers. -
- -This is a regular DOM setup for comparison:
- -- This popover is in regular DOM (not shadow DOM) and should also work - correctly. -
-This popover should track scrolling in both containers
-- The button is inside a shadow DOM with nested scroll containers. The - popover should follow when scrolling either container. -
- -