Merge pull request #15849 from calixteman/15744
[Editor] Avoid to scroll when an annotation is commited (fixes issue #15744)
This commit is contained in:
commit
dd96ee1512
@ -252,11 +252,11 @@ class FreeTextEditor extends AnnotationEditor {
|
|||||||
this.editorDiv.removeEventListener("blur", this.#boundEditorDivBlur);
|
this.editorDiv.removeEventListener("blur", this.#boundEditorDivBlur);
|
||||||
this.editorDiv.removeEventListener("input", this.#boundEditorDivInput);
|
this.editorDiv.removeEventListener("input", this.#boundEditorDivInput);
|
||||||
|
|
||||||
if (this.pageIndex === this._uiManager.currentPageIndex) {
|
// On Chrome, the focus is given to <body> when contentEditable is set to
|
||||||
// On Chrome, the focus is given to <body> when contentEditable is set to
|
// false, hence we focus the div.
|
||||||
// false, hence we focus the div.
|
this.div.focus({
|
||||||
this.div.focus();
|
preventScroll: true /* See issue #15744 */,
|
||||||
}
|
});
|
||||||
|
|
||||||
// In case the blur callback hasn't been called.
|
// In case the blur callback hasn't been called.
|
||||||
this.isEditing = false;
|
this.isEditing = false;
|
||||||
|
@ -517,11 +517,9 @@ class InkEditor extends AnnotationEditor {
|
|||||||
// When commiting, the position of this editor is changed, hence we must
|
// When commiting, the position of this editor is changed, hence we must
|
||||||
// move it to the right position in the DOM.
|
// move it to the right position in the DOM.
|
||||||
this.parent.moveEditorInDOM(this);
|
this.parent.moveEditorInDOM(this);
|
||||||
if (this.pageIndex === this._uiManager.currentPageIndex) {
|
this.div.focus({
|
||||||
// After the div has been moved in the DOM, the focus may have been stolen
|
preventScroll: true /* See issue #15744 */,
|
||||||
// by document.body, hence we just keep it here.
|
});
|
||||||
this.div.focus();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @inheritdoc */
|
/** @inheritdoc */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user