We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 08c03c5 commit c906ea5Copy full SHA for c906ea5
_build/js/src/ui/localChat/modalHeader.ts
@@ -91,12 +91,15 @@ export const buildModalHeader = () => {
91
});
92
93
94
- document.addEventListener('keydown', (e) => {
+ const onKeyDown = (e: KeyboardEvent) => {
95
if (e.key === 'Escape') {
96
e.preventDefault();
97
closeModal();
98
+ document.removeEventListener('keydown', onKeyDown);
99
}
- });
100
+ };
101
+
102
+ document.addEventListener('keydown', onKeyDown);
103
104
globalState.modal.closeModalBtn = closeModalBtn;
105
0 commit comments