From c2fcc66302d40b39fa20e5a4f814aa6d5f63d64e Mon Sep 17 00:00:00 2001 From: Calixte Denizet Date: Sun, 18 Feb 2024 19:21:45 +0100 Subject: [PATCH] [Editor] Avoid to scroll when an editor is unselected --- src/display/editor/editor.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/display/editor/editor.js b/src/display/editor/editor.js index d5547aee8..534cdd0a4 100644 --- a/src/display/editor/editor.js +++ b/src/display/editor/editor.js @@ -1503,7 +1503,9 @@ class AnnotationEditor { if (this.div?.contains(document.activeElement)) { // Don't use this.div.blur() because we don't know where the focus will // go. - this._uiManager.currentLayer.div.focus(); + this._uiManager.currentLayer.div.focus({ + preventScroll: true, + }); } this.#editToolbar?.hide(); }