Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WRR-16145: ContextualPopupDecorator: Modified to update position when DOM tree changes #1796

Open
wants to merge 2 commits into
base: release/2.9.x.develop
Choose a base branch
from

Conversation

mmyelyn
Copy link
Contributor

@mmyelyn mmyelyn commented Jan 6, 2025

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
  • Documentation was added or is not needed
  • This is an API breaking change

Issue Resolved / Feature Added

After the dropdown is opened, if the DOM tree changes, the position of the dropdown will not change.

Resolution

Because Dropdown component uses ContextualPopupDecorator, I added mutationObserver to ContextualPopupDecrator to detect changes in the DOM tree. Since we don't know which part of the DOM will change, I attach an observer to document.body and update the location when there is a change.

Additional Considerations

Links

WRR-16145

Comments

Enact-DCO-1.0-Signed-off-by: Hyelyn Kim ([email protected])

… DOM tree changes

Enact-DCO-1.0-Signed-off-by: Hyelyn Kim ([email protected])
Copy link

codecov bot commented Jan 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.94%. Comparing base (b5f3dc7) to head (6d81506).

Additional details and impacted files
@@                    Coverage Diff                    @@
##           release/2.9.x.develop    #1796      +/-   ##
=========================================================
+ Coverage                  80.91%   80.94%   +0.03%     
=========================================================
  Files                        148      148              
  Lines                       6697     6708      +11     
  Branches                    1995     2000       +5     
=========================================================
+ Hits                        5419     5430      +11     
  Misses                       970      970              
  Partials                     308      308              

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

Enact-DCO-1.0-Signed-off-by: Hyelyn Kim ([email protected])
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