Skip to content

Commit

Permalink
Added optional chaining to handle cases where props.preventScroll doe…
Browse files Browse the repository at this point in the history
…s not exist

Enact-DCO-1.0-Signed-off-by: Juwon Jeong ([email protected])
  • Loading branch information
juwonjeong committed Dec 5, 2024
1 parent dafced6 commit 0489fc8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/ui/useScroll/useScroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ const useScrollBase = (props) => {
scrollByPage(ev.keyCode);
}
} else {
props.preventScroll(ev);
props.preventScroll?.(ev);

Check warning on line 816 in packages/ui/useScroll/useScroll.js

View check run for this annotation

Codecov / codecov/patch

packages/ui/useScroll/useScroll.js#L816

Added line #L816 was not covered by tests
forward('onKeyDown', ev, props);
}
}
Expand Down

0 comments on commit 0489fc8

Please sign in to comment.