Merge pull request #17330 from calixteman/issue17327

[Editor] Only focus the canvas for mouse events when drawing in the canvas
This commit is contained in:
calixteman 2023-11-24 19:09:18 +01:00 committed by GitHub
commit 58316369e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -660,8 +660,13 @@ class InkEditor extends AnnotationEditor {
event.preventDefault();
if (event.type !== "mouse") {
this.div.focus();
if (
event.pointerType !== "mouse" &&
!this.div.contains(document.activeElement)
) {
this.div.focus({
preventScroll: true /* See issue #17327 */,
});
}
this.#startDrawing(event.offsetX, event.offsetY);