Apply suggested fix to app/components/EditorAwareHTML5Backend.ts from Copilot Autofix (#13126)

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
This commit is contained in:
Tom MoorandCopilot Autofix powered by AI authored and GitHub committed 2026-07-25 07:56:23 -04:00
1 parent d63372694b
commit 7fed1597df
1 file changed
+5 -2
+5 -2
View File
@@ -62,11 +62,14 @@ export const EditorAwareHTML5Backend: BackendFactory = (
}
// A drag that began or entered the page over the editor is never
// registered with react-dnd because those events are skipped above.
// The backend's drop handler assumes a registered drag and calls
// The backend's drop handlers assume a registered drag and may call
// `actions.hover` unconditionally, which throws "Cannot call hover
// while not dragging" – so drops without a tracked drag must be
// ignored here.
if (name === "handleTopDrop" && !monitor.isDragging()) {
if (
(name === "handleTopDrop" || name === "handleTopDropCapture") &&
!monitor.isDragging()
) {
return;
}
original.call(backend, event);