diff --git a/ruby_event_store-browser/public/bootstrap.js b/ruby_event_store-browser/public/bootstrap.js index f635744be2..17eb71f537 100644 --- a/ruby_event_store-browser/public/bootstrap.js +++ b/ruby_event_store-browser/public/bootstrap.js @@ -16,6 +16,12 @@ window.addEventListener("keydown", function (event) { app.ports.requestSearch.send(null); event.preventDefault(); } + + if (event.key === "Escape") { + const dialog = document.querySelector(`#${id}`); + dialog.open ? dialog.close() : null; + event.preventDefault(); + } }); app.ports.toggleBookmark.subscribe(function (id) {