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 #1722

Closed mmyelyn closed 2 weeks 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.56%. Comparing base (6305cdd) to head (fdb2ae5). Report is 1 commits behind head on release/2.7.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.7.x.develop #1722 +/- ## ========================================================= + Coverage 80.52% 80.56% +0.03% ========================================================= Files 142 142 Lines 6497 6509 +12 Branches 1919 1924 +5 ========================================================= + Hits 5232 5244 +12 Misses 963 963 Partials 302 302 ```

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