[Editor] Only focus the canvas for mouse events when drawing in the canvas
And if we've to focus it, we must prevent scrolling to avoid to draw at an unexpected position.
This commit is contained in:
parent
d679078beb
commit
42147e8839
@ -660,8 +660,13 @@ class InkEditor extends AnnotationEditor {
|
|||||||
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
if (event.type !== "mouse") {
|
if (
|
||||||
this.div.focus();
|
event.pointerType !== "mouse" &&
|
||||||
|
!this.div.contains(document.activeElement)
|
||||||
|
) {
|
||||||
|
this.div.focus({
|
||||||
|
preventScroll: true /* See issue #17327 */,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
this.#startDrawing(event.offsetX, event.offsetY);
|
this.#startDrawing(event.offsetX, event.offsetY);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user