Fix escape handling

This commit is contained in:
Jamie Kyle
2023-03-23 15:35:15 -07:00
committed by GitHub
parent e819984239
commit 9fe7bb41ec

View File

@@ -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]);
}