Open pahaz opened 9 years ago
Hi Pahaz,
I was not aware of the issue, i will test it out and make a fix when i got the time
I was able to work around the problem by adding a drop handler which repositions the cursor to the drop location when it detects a file is being dropped. Here's the typescript from our editor subclass, where this.cm is of type CodeMirror.Editor
:
this.cm.on('drop', (editor, e: DragEvent) => {
if (e.dataTransfer.files.length > 0) {
let pos = this.cm.coordsChar({left: e.clientX, top: e.clientY}, 'window');
this.cm.getDoc().setCursor(pos);
}
});
This has to be done before the call to codemirror4.attach()
so it gets called before the inlineAttachment drop handler.
Hi. We use InlineAttacjment with CodeMirror 5.6.0.
When dropping file to the editor it drop to the previous coursor position (not to the line where we release mouse).
Do you know about this?
Is this a correct behavior?