Skip to content

Commit 48cc67f

Browse files
authored
Merge pull request #16741 from calixteman/editor_no_ed_when_pinching
[Editor] Avoid to trigger an editor creation when pinching on a touchscreen
2 parents e40fd17 + 6b545d6 commit 48cc67f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/display/editor/annotation_editor_layer.js

+9
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,15 @@ class AnnotationEditorLayer {
553553
* @param {PointerEvent} event
554554
*/
555555
pointerdown(event) {
556+
if (this.#hadPointerDown) {
557+
// It's possible to have a second pointerdown event before a pointerup one
558+
// when the user puts a finger on a touchscreen and then add a second one
559+
// to start a pinch-to-zoom gesture.
560+
// That said, in case it's possible to have two pointerdown events with
561+
// a mouse, we don't want to create a new editor in such a case either.
562+
this.#hadPointerDown = false;
563+
return;
564+
}
556565
const { isMac } = FeatureTest.platform;
557566
if (event.button !== 0 || (event.ctrlKey && isMac)) {
558567
// Do nothing on right click.

0 commit comments

Comments
 (0)