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-11077: Fixed Scroller to prevent the native scrolling behavior caused by keydown events when the popup is opened #3297

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

juwonjeong
Copy link
Contributor

@juwonjeong juwonjeong commented Nov 25, 2024

Enact-DCO-1.0-Signed-off-by: Juwon Jeong ([email protected])

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

In this case, the Scroller has a button that opens FixedPopupPanel. The issue is that when press the down key at the moment the popup is opened, the scroller behind the FixedPopupPanel scrolls down.

Resolution

To fix this issue, we have to prevent the native scrolling behavior caused by keydown events.
So I fixed keydown handler of scrollerContainer to call preventDefault when a keydown event is caused by a directional key and the spotlight is paused.
To not to have spotlight dependency, the preventing function resides in sandstone and enact/Scroller just calls the funcion passed by prop like other cases.

Additional Considerations

Links

WRR-11077

Comments

…used by keydown events when the popup is opened

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

codecov bot commented Nov 25, 2024

Codecov Report

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

Project coverage is 82.29%. Comparing base (b2fc7be) to head (dafced6).

Files with missing lines Patch % Lines
packages/ui/useScroll/useScroll.js 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3297      +/-   ##
===========================================
- Coverage    82.30%   82.29%   -0.01%     
===========================================
  Files          152      152              
  Lines         7091     7093       +2     
  Branches      1867     1867              
===========================================
+ Hits          5836     5837       +1     
- Misses         985      986       +1     
  Partials       270      270              

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

Copy link
Contributor

@MikyungKim MikyungKim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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.

2 participants