Skip to content

Commit

Permalink
Merge branch 'main' into feat/prepend-client-directive
Browse files Browse the repository at this point in the history
  • Loading branch information
simonguo committed Oct 26, 2023
2 parents f78c6db + 8a9f06b commit 928c4e9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/utils/useScrollListener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ const momentumTimeThreshold = 300;
// Inertial sliding start vertical distance threshold
const momentumYThreshold = 15;

//List of Arrow Keys for scrolling through keys
const arrowKeysList = ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'];

interface ScrollListenerProps {
rtl: boolean;
data: readonly RowDataType[];
Expand Down Expand Up @@ -506,7 +509,7 @@ const useScrollListener = (props: ScrollListenerProps) => {

const onScrollByKeydown = useCallback(
(event: React.KeyboardEvent) => {
if (event.currentTarget === event.target) {
if (event.currentTarget === event.target && arrowKeysList.indexOf(event.key) > -1) {
event.preventDefault();
const step = 40;

Expand Down

0 comments on commit 928c4e9

Please sign in to comment.