From 09db0efb7c89821901d249095bcf4d94647ae269 Mon Sep 17 00:00:00 2001 From: Artem Nistuley Date: Tue, 20 Jan 2026 13:50:26 +0200 Subject: [PATCH] fix: annotation drop --- .../core/presentation-editor/input/DragDropManager.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/super-editor/src/core/presentation-editor/input/DragDropManager.ts b/packages/super-editor/src/core/presentation-editor/input/DragDropManager.ts index 47be10bbc..c0e3d9b82 100644 --- a/packages/super-editor/src/core/presentation-editor/input/DragDropManager.ts +++ b/packages/super-editor/src/core/presentation-editor/input/DragDropManager.ts @@ -138,8 +138,15 @@ function extractFieldAnnotationData(element: HTMLElement): FieldAnnotationDragDa */ function hasFieldAnnotationData(event: DragEvent): boolean { if (!event.dataTransfer) return false; - const types = event.dataTransfer.types; - return types.includes(INTERNAL_MIME_TYPE) || types.includes(FIELD_ANNOTATION_DATA_TYPE); + const types = Array.from(event.dataTransfer.types ?? []); + const lowerTypes = types.map((type) => type.toLowerCase()); + const hasFieldAnnotationType = + lowerTypes.includes(INTERNAL_MIME_TYPE.toLowerCase()) || + lowerTypes.includes(FIELD_ANNOTATION_DATA_TYPE.toLowerCase()); + if (hasFieldAnnotationType) return true; + return Boolean( + event.dataTransfer.getData(INTERNAL_MIME_TYPE) || event.dataTransfer.getData(FIELD_ANNOTATION_DATA_TYPE), + ); } /**