From 9fe7bb41ec6cd5a84c14b10b00085946387cbbb6 Mon Sep 17 00:00:00 2001 From: Jamie Kyle <113370520+jamiebuilds-signal@users.noreply.github.com> Date: Thu, 23 Mar 2023 15:35:15 -0700 Subject: [PATCH] Fix escape handling --- ts/hooks/useEscapeHandling.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/ts/hooks/useEscapeHandling.ts b/ts/hooks/useEscapeHandling.ts index 9a4110b5d..c35a81f37 100644 --- a/ts/hooks/useEscapeHandling.ts +++ b/ts/hooks/useEscapeHandling.ts @@ -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]); }