Skip to content

Commit

Permalink
typing: set right type for esc (#253)
Browse files Browse the repository at this point in the history
  • Loading branch information
polRk authored Jul 3, 2021
1 parent 7e0021c commit 5d7a366
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useEffect, RefObject, useLayoutEffect } from 'react';
export const useOnEscape = (handler: () => void, active = true) => {
useEffect(() => {
if (!active) return;
const listener = (event: any) => {
const listener = (event: KeyboardEvent) => {
// check if key is an Escape
if (event.key === 'Escape') handler();
};
Expand Down Expand Up @@ -72,7 +72,7 @@ export const useTabbing = (
) => {
useEffect(() => {
if (!active) return;
const listener = (event: any) => {
const listener = (event: KeyboardEvent) => {
// check if key is an Tab
if (event.keyCode === 9) {
const els = contentRef?.current?.querySelectorAll(
Expand Down

0 comments on commit 5d7a366

Please sign in to comment.