Skip to content

Commit

Permalink
Fix escape handling
Browse files Browse the repository at this point in the history
Co-authored-by: Jamie Kyle <113370520+jamiebuilds-signal@users.noreply.github.com>
  • Loading branch information
automated-signal and jamiebuilds-signal committed Mar 24, 2023
1 parent fb8ef42 commit b0177c6
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions ts/hooks/useEscapeHandling.ts
Expand Up @@ -17,14 +17,10 @@ export function useEscapeHandling(handleEscape?: () => unknown): void {
event.stopPropagation();
}
};
document.addEventListener('keydown', handler, {
capture: true,
});
document.addEventListener('keydown', handler);

return () => {
document.removeEventListener('keydown', handler, {
capture: true,
});
document.removeEventListener('keydown', handler);
};
}, [handleEscape]);
}

0 comments on commit b0177c6

Please sign in to comment.