Fix escape handling
This commit is contained in:
@@ -17,14 +17,10 @@ export function useEscapeHandling(handleEscape?: () => unknown): void {
|
|||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
document.addEventListener('keydown', handler, {
|
document.addEventListener('keydown', handler);
|
||||||
capture: true,
|
|
||||||
});
|
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
document.removeEventListener('keydown', handler, {
|
document.removeEventListener('keydown', handler);
|
||||||
capture: true,
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
}, [handleEscape]);
|
}, [handleEscape]);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user