mirror of
https://github.com/outline/outline.git
synced 2026-12-05 02:44:34 +03:00
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:
1 parent
d63372694b
commit
7fed1597df
1 file changed
+5
-2
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user