diff --git a/client/scripts/ui.js b/client/scripts/ui.js index 93dd77e..3e2af9c 100644 --- a/client/scripts/ui.js +++ b/client/scripts/ui.js @@ -215,9 +215,13 @@ class Dialog { this.$el.querySelectorAll("[close]").forEach((el) => { el.addEventListener("click", (e) => this.hide()); }); - this.$el.querySelectorAll("[role=\"textbox\"]").forEach((el) => { - el.addEventListener("click", (e) => this.hide()); + this.$el.querySelectorAll('[role="textbox"]').forEach((el) => { + el.addEventListener("keypress", (e) => { + if (e.key == "Escape") { + this.hide(); + } }); + }); this.$autoFocus = this.$el.querySelector("[autofocus]"); }