Prevent browser loading a drag--and-drop file

Hello, how can I prevent the browser from loading a dropped file on the contenteditable? I still need to process the drop and update the content with some markup.

handleDrop would be the thing, I guess.

handleDrop does not work in this case (works for dropped text). It is not even reached in the case of files…

Ahh, that’s a bug similar to this one for handlePaste. This patch should help.

handleDrop is still not reached, as slice is null. if (!slice) return

Isn’t that exactly what the patch I linked changes?

yes indeed, that fixes the problem.