Skip to content

Commit

Permalink
Handle additional cases for drag drop in editor
Browse files Browse the repository at this point in the history
  • Loading branch information
tddang-linagora committed Nov 19, 2024
1 parent 3274d7f commit 424e088
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/src/widgets/html_editor_widget_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,18 @@ class _HtmlEditorWidgetWebState extends State<HtmlEditorWidget> {
event.preventDefault();
window.parent.postMessage(JSON.stringify({"view": "$createdViewId", "type": "toDart: onDragLeave", "types": event.dataTransfer.types}), "*");
});
document.getElementsByClassName('note-editor')[0].addEventListener("dragover", function(event) {
if (event.dataTransfer.types.includes("Files")) {
event.preventDefault();
}
});
document.getElementsByClassName('note-editor')[0].addEventListener("drop", function(event) {
if (event.dataTransfer.types.includes("Files")) {
event.preventDefault();
}
});
}
$userScripts
}
Expand Down

0 comments on commit 424e088

Please sign in to comment.