WRR-11077: Fixed Scroller to prevent the native scrolling behavior caused by keydown events when the popup is opened #3297
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Enact-DCO-1.0-Signed-off-by: Juwon Jeong ([email protected])
Checklist
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