From 0016ef97bbdd7f9fcfdb662c3ac7f80ab872f987 Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Wed, 5 Feb 2025 04:40:01 -0800 Subject: [PATCH] hide modal on escape --- static/js/app.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/static/js/app.js b/static/js/app.js index 5aedfa9..8eb4674 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -380,6 +380,13 @@ modal.addEventListener('click', (e) => { } }); +// Close modal when pressing escape +document.addEventListener('keydown', (e) => { + if (e.key === 'Escape' && modal.classList.contains('show')) { + hideModal(); + } +}); + confirmButton.addEventListener('click', async () => { const url = document.getElementById('feedUrl').value.trim();