From 67a1cba1bca441fb0dc4d3993fddc1fc8899cd95 Mon Sep 17 00:00:00 2001 From: Bryan Valverde U Date: Mon, 30 Sep 2024 09:27:28 -0600 Subject: [PATCH] Add a ID to the TempDiv, to be able to identify on blur was caused for copy/cut #2813 --- .../lib/corePlugin/copyPaste/CopyPastePlugin.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/roosterjs-content-model-core/lib/corePlugin/copyPaste/CopyPastePlugin.ts b/packages/roosterjs-content-model-core/lib/corePlugin/copyPaste/CopyPastePlugin.ts index b0fd0c791d9..62ba6d1248e 100644 --- a/packages/roosterjs-content-model-core/lib/corePlugin/copyPaste/CopyPastePlugin.ts +++ b/packages/roosterjs-content-model-core/lib/corePlugin/copyPaste/CopyPastePlugin.ts @@ -33,6 +33,8 @@ import type { ReadonlyTableSelectionContext, } from 'roosterjs-content-model-types'; +const TEMP_DIV_ID = 'roosterJS_copyCutTempDiv'; + /** * Copy and paste plugin for handling onCopy and onPaste event */ @@ -235,6 +237,7 @@ class CopyPastePlugin implements PluginWithState { div.childNodes.forEach(node => div.removeChild(node)); div.style.display = ''; + div.id = TEMP_DIV_ID; div.focus(); return div;