Skip to content

Commit

Permalink
Merge pull request #17330 from calixteman/issue17327
Browse files Browse the repository at this point in the history
[Editor] Only focus the canvas for mouse events when drawing in the canvas
  • Loading branch information
calixteman authored Nov 24, 2023
2 parents d679078 + 42147e8 commit 5831636
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/display/editor/ink.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5831636

Please sign in to comment.