question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Modify dropImage function to provide drop event for custom plugin

See original GitHub issue

Version

3.0.0

Development Environment

Chrome, Windows 10

Current Behavior

I want to handle drop event for custom file, so I write a plugin like this:

function dropPlugin() {
    return {
        markdownPlugins: [
            function () {
                return new Plugin({
                    props: {
                        handleDrop: (_, evt) => {
                            // ...
                        }
                    }
                });
            }
        ]
    };
}

But I found it don’t work. Because dropImage function always return true. So that prosemirror don’t execute the next handler that I wrote.

Expected Behavior

dropImage function return false when no image file handle.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
calumkcommented, Jun 30, 2021

We need addFileBlobHook or similar.

0reactions
Insolitacommented, Aug 23, 2021

May pr speed up the problem solving?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Make A Drag-and-Drop File Uploader With Vanilla ...
A demonstration of a web page in which you can upload images via drag and drop, preview the images being uploaded immediately, and...
Read more >
Create a drag-and-drop with react-dropzone - LogRocket Blog
Learn how to use react-dropzone to create a drag-and-drop component for uploading images. Compare this to the HTML Drag and Drop API method....
Read more >
Drag and drop - Android Developers
You create a drag event listener by implementing View.OnDragListener . You set the listener for a drop target with the View object's ...
Read more >
Which event get triggers on image drag and drop using Tinymce
I do not know about the uploadImages function callback. You will have to add own handlers to the tinymce body that will react...
Read more >
Drag and drop elements within your rich text editor - TinyMCE
To create the demo, start by getting a FREE API key, which gives you 14 days access to TinyMCE Premium plugins, as well...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found