Hello,
I’m modifying a community plugin so that “editor-drop” is handled.
- I bind
editor-drop
to my handler (handleDrop
) :
this.registerEvent(this.app.workspace.on("editor-drop", this.handleDrop.bind(this)));
- In
handleDrop
, the following part works fine on desktop but not on mobile (iPadOS) :
...
event.preventDefault();
let img = yield blobToArrayBuffer(pasteImage);
let name = this.getPastedImageFileName(mdFileName);
console.log(name);
console.log(fullPath);
let imageFile = yield this.app.saveAttachment(name, extension, img);
let markdownLink = yield this.app.fileManager.generateMarkdownLink(imageFile, view.file.path);
markdownLink += "\n\n";
editor.replaceSelection(markdownLink);
I think it is due to a different behavior with preventDefault()
. It seems that nothing after event.preventDefault()
is executed on mobile.
Has someone an idea on how to solve this ?
Thanks !