Escape out of more menus

This commit is contained in:
MathMan05
2025-10-11 15:06:28 -05:00
parent afa3b8e59d
commit 0c6244f4c9
2 changed files with 12 additions and 0 deletions
+5
View File
@@ -72,6 +72,11 @@ class ImagesDisplay {
this.background.onclick = (_) => {
this.hide();
};
this.background.onkeydown = (e) => {
if (e.key === "Escape") {
this.hide();
}
};
document.body.append(this.background);
this.background.setAttribute("tabindex", "0");
this.background.focus();
+7
View File
@@ -878,6 +878,13 @@ class Dialog {
removeAni(background);
}
};
background.tabIndex = 0;
background.focus();
background.onkeydown = (e) => {
if (e.key === "Escape" && hideOnClick) {
removeAni(background);
}
};
return center;
}
hide() {