editor: fix crash on drag dropping an embed node

This commit is contained in:
Abdullah Atta
2024-08-27 13:02:10 +05:00
committed by Abdullah Atta
parent ac85002dff
commit 025e23356a

View File

@@ -1,5 +1,5 @@
diff --git a/node_modules/prosemirror-view/dist/index.cjs b/node_modules/prosemirror-view/dist/index.cjs
index 81a331c..5d6a5fa 100644
index 81a331c..6e60d39 100644
--- a/node_modules/prosemirror-view/dist/index.cjs
+++ b/node_modules/prosemirror-view/dist/index.cjs
@@ -3380,7 +3380,7 @@ editHandlers.drop = function (view, _event) {
@@ -7,12 +7,12 @@ index 81a331c..5d6a5fa 100644
tr.setSelection(selectionBetween(view, $pos, tr.doc.resolve(end)));
}
- view.focus();
+ if (!dragging.nodeView) view.focus();
+ if (!dragging || !dragging.nodeView) view.focus();
view.dispatch(tr.setMeta("uiEvent", "drop"));
};
handlers.focus = function (view) {
diff --git a/node_modules/prosemirror-view/dist/index.js b/node_modules/prosemirror-view/dist/index.js
index e076a13..5cd837f 100644
index e076a13..2a0fea5 100644
--- a/node_modules/prosemirror-view/dist/index.js
+++ b/node_modules/prosemirror-view/dist/index.js
@@ -3647,7 +3647,7 @@ editHandlers.drop = (view, _event) => {
@@ -20,7 +20,7 @@ index e076a13..5cd837f 100644
tr.setSelection(selectionBetween(view, $pos, tr.doc.resolve(end)));
}
- view.focus();
+ if (!dragging.nodeView) view.focus();
+ if (!dragging || !dragging.nodeView) view.focus();
view.dispatch(tr.setMeta("uiEvent", "drop"));
};
handlers.focus = view => {