From 9984afe6a6dc7f771b67390a42c2877d74511c18 Mon Sep 17 00:00:00 2001 From: Calixte Denizet Date: Tue, 18 Feb 2025 10:53:27 +0100 Subject: [PATCH] [Editor] Wait for switching to stamp mode before adding a new editor when dnd'ing an image When dnd'ing an image with the FreeText mode enabled, the image wasn't correctly added. --- src/display/editor/annotation_editor_layer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/display/editor/annotation_editor_layer.js b/src/display/editor/annotation_editor_layer.js index 2dbcfa13b..b15d64cc1 100644 --- a/src/display/editor/annotation_editor_layer.js +++ b/src/display/editor/annotation_editor_layer.js @@ -621,9 +621,9 @@ class AnnotationEditorLayer { * @param {number} mode * @param {Object} params */ - pasteEditor(mode, params) { + async pasteEditor(mode, params) { this.#uiManager.updateToolbar(mode); - this.#uiManager.updateMode(mode); + await this.#uiManager.updateMode(mode); const { offsetX, offsetY } = this.#getCenterPoint(); const id = this.getNextId();