fix: buttons and actions no longer getting stuck

fix: context menu resizes if accordion is opened
feat: added expanding descriptions for context actions
This commit is contained in:
Davide Passoni
2024-12-11 18:06:59 +01:00
parent e9896963ca
commit 7fe9b0d19f
16 changed files with 145 additions and 64 deletions

View File

@@ -20,7 +20,17 @@ export class Shortcut {
document.addEventListener("keyup", (ev: any) => {
if (this.#modal) return;
if (this.#keydown && this.getOptions().code === ev.code) {
console.log(`Keydown up for shortcut ${this.#id}`)
console.log(`Keyup for shortcut ${this.#id}`)
ev.preventDefault();
this.#keydown = false;
this.getOptions().keyUpCallback(ev);
}
});
/* Forced keyup, in case the window loses focus */
document.addEventListener("blur", (ev: any) => {
if (this.#keydown) {
console.log(`Keyup (forced by blur) for shortcut ${this.#id}`)
ev.preventDefault();
this.#keydown = false;
this.getOptions().keyUpCallback(ev);