Skip to content

NXT-19858: ContextualPopupDecorator: Fixed hole punch scrim to reposition with the popup when the wrapped component is updated - #434

Open
bongsok wants to merge 1 commit into
developfrom
feature/NXT-19858-holepunch
Open

NXT-19858: ContextualPopupDecorator: Fixed hole punch scrim to reposition with the popup when the wrapped component is updated#434
bongsok wants to merge 1 commit into
developfrom
feature/NXT-19858-holepunch

Conversation

@bongsok

@bongsok bongsok commented Sep 14, 2026

Copy link
Copy Markdown

Checklist

  • I have read and understand the contribution guide
  • A CHANGELOG entry is included
  • At least one test case is included for this feature or bug fix
  • I have run automated testing and it is passed
  • Documentation was added or is not needed
  • This is an API breaking change

Issue Resolved / Feature Added

Follow-up to #425 / #426 (NXT-19858). Those changes restored popup (menu) repositioning when the wrapped/activator component is updated, but the hole punch scrim was not addressed: its hole stayed at the position measured on the initial open and no longer lined up with the popup after a reposition.

The holeBounds were measured once in a useEffect keyed on the holepunch flag (which is effectively constant), so setHoleBounds never ran again when the activator moved or resized — on observer-driven repositions or a wrapped-component update the hole drifted out of alignment.

Resolution

holeBounds are now measured inside positionContextualPopup, reusing the same activator getBoundingClientRect() already taken to position the popup. Because positionContextualPopup runs on open, on the ResizeObserver/MutationObserver callbacks, and on the reposition effect, the scrim hole now stays in sync with the popup on every reposition. A change guard (functional setHoleBounds update) skips the state update when the bounds are unchanged so observer ticks don't cause needless re-renders.

Additional Considerations

Added a guard test should keep the hole punch scrim hole applied when the wrapped component is updated that opens with scrimType="holepunch", asserts the scrim's computed --hole-* CSS custom properties are applied, updates the wrapped component, and re-asserts.

Verified on this branch:

  • enact lint --strict — passes (no output)
  • ContextualPopupDecorator suite — 28/28 passing, including the new hole punch scrim guard test

Links

NXT-19858 (follow-up to #425 / #426)

Comments

Targets develop. An equivalent backport PR (#433) is opened against release/1.11.x.develop.

@codecov

codecov Bot commented Sep 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.29%. Comparing base (aa7201f) to head (2718e14).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #434      +/-   ##
===========================================
+ Coverage    83.24%   83.29%   +0.05%     
===========================================
  Files          155      155              
  Lines         7824     7832       +8     
  Branches      2413     2417       +4     
===========================================
+ Hits          6513     6524      +11     
+ Misses        1019     1016       -3     
  Partials       292      292              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…tion with the popup when the wrapped component is updated

The holeBounds were measured once in an effect keyed on the (effectively constant)
holepunch flag, so the scrim's hole never followed the popup when it repositioned after a
wrapped-component update. Measure holeBounds inside positionContextualPopup from the same
rect used to position the popup so the hole stays in sync on every reposition.

Enact-DCO-1.0-Signed-off-by: Bongseok Choi (bongseok13.choi@lge.com)
@bongsok
bongsok force-pushed the feature/NXT-19858-holepunch branch from b1371b8 to 2718e14 Compare September 14, 2026 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant