mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 09:20:06 +02:00
[Editor] Support resizing editors with the keyboard (bug 1854340)
This commit is contained in:
parent
426209c6e6
commit
05ca3fd99b
5 changed files with 469 additions and 88 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue