Merge pull request #21092 from Snuffleupagus/AnnotationEditorLayer-stopEvent

Use the `stopEvent` helper function in the `AnnotationEditorLayer` class
This commit is contained in:
Tim van der Meij 2026-04-12 18:31:31 +02:00 committed by GitHub
commit 89b195d35c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -30,11 +30,11 @@ import {
AnnotationEditorType, AnnotationEditorType,
FeatureTest, FeatureTest,
} from "../../shared/util.js"; } from "../../shared/util.js";
import { setLayerDimensions, stopEvent } from "../display_utils.js";
import { AnnotationEditor } from "./editor.js"; import { AnnotationEditor } from "./editor.js";
import { FreeTextEditor } from "./freetext.js"; import { FreeTextEditor } from "./freetext.js";
import { HighlightEditor } from "./highlight.js"; import { HighlightEditor } from "./highlight.js";
import { InkEditor } from "./ink.js"; import { InkEditor } from "./ink.js";
import { setLayerDimensions } from "../display_utils.js";
import { SignatureEditor } from "./signature.js"; import { SignatureEditor } from "./signature.js";
import { StampEditor } from "./stamp.js"; import { StampEditor } from "./stamp.js";
@ -344,8 +344,7 @@ class AnnotationEditorLayer {
} }
const editor = this.#editors.get(id); const editor = this.#editors.get(id);
if (editor?.annotationElementId === null) { if (editor?.annotationElementId === null) {
e.stopPropagation(); stopEvent(e);
e.preventDefault();
editor.dblclick(e); editor.dblclick(e);
} }
}, },