Commit dd70d3d0 by Яков

fix drag and drop

parent 4011a958
...@@ -20,11 +20,11 @@ const DragAndDrop = Extension.create({ ...@@ -20,11 +20,11 @@ const DragAndDrop = Extension.create({
key: new PluginKey('customDragAndDrop'), key: new PluginKey('customDragAndDrop'),
props: { props: {
handleDOMEvents: { handleDOMEvents: {
// async paste (view, event) { async paste (view, event) {
//
// console.log(event.clipboardData); console.log('Clipboard types:', event.clipboardData.types);
// // console.log(event.originalEvent.clipboardData); console.log('HTML data length:', event.clipboardData.getData('text/html').length);
//
// let items = (event.clipboardData || event.originalEvent.clipboardData).items; // let items = (event.clipboardData || event.originalEvent.clipboardData).items;
// //
// for (let i = 0; i < items.length; i++){ // for (let i = 0; i < items.length; i++){
...@@ -44,7 +44,7 @@ const DragAndDrop = Extension.create({ ...@@ -44,7 +44,7 @@ const DragAndDrop = Extension.create({
// const transaction = view.state.tr.replaceSelectionWith(node); // const transaction = view.state.tr.replaceSelectionWith(node);
// view.dispatch(transaction) // view.dispatch(transaction)
// } // }
// }, },
async drop (view, event) { async drop (view, event) {
const hasFiles = event.dataTransfer.files.length > 0; const hasFiles = event.dataTransfer.files.length > 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment