Skip to content

Commit

Permalink
style: addresses feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
micheleriva committed Jan 22, 2024
1 parent da148e2 commit f876fa6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion hooks/react-client/useClickOutside.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const useClickOutside = <T extends HTMLElement>(
useEffect(() => {
const element = ref?.current;
const handleClickOutside = (event: Event) => {
if (element && !element.contains(event.target as Node | null)) {
if (element && !element.contains(event.currentTarget as Node)) {
fn();
}
};
Expand Down
4 changes: 1 addition & 3 deletions hooks/react-client/useKeyboardCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ const useKeyboardCommands = (fn: KeyboardCommandCallback) => {
}
});

return () => {
document.removeEventListener('keydown', () => {});
};
return () => document.removeEventListener('keydown', () => {});
}, []);
};

Expand Down

0 comments on commit f876fa6

Please sign in to comment.