enactjs / sandstone

The set of components for an Enact-based application targeting smart TVs
Apache License 2.0
22 stars 3 forks source link

WRR-976: ContextualPopupDecorator: Modified to update position when screen orientation change #1721

Closed mmyelyn closed 1 week ago

mmyelyn commented 1 month ago

Checklist

Issue Resolved / Feature Added

When ContextualPopupDecorator or ContextualMenuDecorator is open, rotating the device in the inspector should change the popup's position. Currently the popup is fixed and does not update.

Resolution

I needed to check whether the position had not been updated or the value had been entered incorrectly. When rotated, I saw that when I refreshed, the position was calculated normally again. Therefore, the position calculation was no problem.

The position is updated with the positionContextualPopup function, which is not called when the window size changes, including when the screen is rotated. Therefore, I modified it to use ResizeObserver to detect changes in FloatLayer. (document.body may or may not have a size depending on the app)

Additional Considerations

Links

WRR-976

Comments

Enact-DCO-1.0-Signed-off-by: Hyelyn Kim (myelyn.kim@lge.com)

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 91.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 80.86%. Comparing base (cb11301) to head (78dfa46). Report is 1 commits behind head on release/2.9.x.develop.

Files with missing lines Patch % Lines
...ntextualPopupDecorator/ContextualPopupDecorator.js 91.66% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## release/2.9.x.develop #1721 +/- ## ========================================================= + Coverage 80.83% 80.86% +0.03% ========================================================= Files 148 148 Lines 6689 6701 +12 Branches 1991 1996 +5 ========================================================= + Hits 5407 5419 +12 Misses 973 973 Partials 309 309 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

MikyungKim commented 3 weeks ago

The current travis fail will be fixed by WRR-6697. Please check again when it's about to merge.