[Editor] Support resizing editors with the keyboard (bug 1854340)

This commit is contained in:
Calixte Denizet 2023-10-03 15:02:54 +02:00
parent 426209c6e6
commit 05ca3fd99b
5 changed files with 469 additions and 88 deletions

View file

@ -1021,7 +1021,7 @@ class AnnotationEditorUIManager {
* @param {KeyboardEvent} event
*/
keydown(event) {
if (!this.getActive()?.shouldGetKeyboardEvents()) {
if (!this.isEditorHandlingKeyboard) {
AnnotationEditorUIManager._keyboardManager.exec(this, event);
}
}
@ -1732,6 +1732,14 @@ class AnnotationEditorUIManager {
}
}
get isEditorHandlingKeyboard() {
return (
this.getActive()?.shouldGetKeyboardEvents() ||
(this.#selectedEditors.size === 1 &&
this.#selectedEditors.values().next().value.shouldGetKeyboardEvents())
);
}
/**
* Is the current editor the one passed as argument?
* @param {AnnotationEditor} editor