Skip to content

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

Open
bongsok wants to merge 1 commit into
release/1.11.x.developfrom
feature/NXT-19858-holepunch-1.11.x
Open

bongsok wants to merge 1 commit into
release/1.11.x.developfrom
feature/NXT-19858-holepunch-1.11.x

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 #426 (NXT-19858). That change 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-20290 (follow-up to #426)

Comments

Targets release/1.11.x.develop. An equivalent PR is opened against develop.

@codecov

codecov Bot commented Sep 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (release/1.11.x.develop@b1623d1). Learn more about missing BASE report.

Additional details and impacted files
@@                    Coverage Diff                    @@
##             release/1.11.x.develop     #433   +/-   ##
=========================================================
  Coverage                          ?   82.74%           
=========================================================
  Files                             ?      153           
  Lines                             ?     7634           
  Branches                          ?     2322           
=========================================================
  Hits                              ?     6317           
  Misses                            ?     1023           
  Partials                          ?      294           

☔ 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-1.11.x branch from 7a3d8a0 to 806fe58 Compare September 14, 2026 09:30
@bongsok bongsok changed the title NXT-19858: ContextualPopupDecorator: Fixed hole punch scrim to reposition with the popup when the wrapped component is updated NXT-20290: ContextualPopupDecorator: Fixed hole punch scrim to reposition with the popup when the wrapped component is updated Sep 15, 2026
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