Skip to content

Commit

Permalink
WRR-11077: Fixed Scroller to prevent the native scrolling behavior ca…
Browse files Browse the repository at this point in the history
…used by keydown events when the popup is opened (#3297)

* WRR-11077: Fixed Scroller to prevent the native scrolling behavior caused by keydown events when the popup is opened

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

* Apply review to remove spotlight dependency in ui

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

* Apply review

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

* Added optional chaining to handle cases where props.preventScroll does not exist

Enact-DCO-1.0-Signed-off-by: Juwon Jeong ([email protected])
  • Loading branch information
juwonjeong authored Dec 5, 2024
1 parent b2fc7be commit dff9a46
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/ui/useScroll/useScroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ const useScrollBase = (props) => {
delete rest.onScrollStart;
delete rest.onScrollStop;
delete rest.onWheel;
delete rest.preventScroll; // scrollMode 'native'
delete rest.removeEventListeners;
delete rest.scrollStopOnScroll; // scrollMode 'native'
delete rest.scrollTo;
Expand Down Expand Up @@ -812,6 +813,7 @@ const useScrollBase = (props) => {
scrollByPage(ev.keyCode);
}
} else {
props.preventScroll?.(ev);
forward('onKeyDown', ev, props);
}
}
Expand Down

0 comments on commit dff9a46

Please sign in to comment.