Skip to content

Commit

Permalink
Added extra validation to useArrowKeys hook (#661)
Browse files Browse the repository at this point in the history
  • Loading branch information
bexsoft authored Feb 9, 2024
1 parent 2bcd57f commit ffd0109
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/global/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const useArrowKeys = (
) => {
const handleArrow = useCallback(
(event: KeyboardEvent) => {
if (event.key.startsWith("Arrow")) {
if (event.key?.startsWith("Arrow")) {
event.preventDefault();
event.stopPropagation();
handleAction(event.key);
Expand Down

0 comments on commit ffd0109

Please sign in to comment.