1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-06-13 00:41:59 +03:00

Attachments: Fixed drag into editor in Chrome

Seemed to be chrome specific from testing.
Required editors to have preventDefault called on dragover.
Tested in Chrome, FF, & Safari.
Tested in both editors, and re-tested text/image drop to ensure still
works.

Fixed #4975
This commit is contained in:
Dan Brown
2024-04-29 19:21:13 +01:00
parent 06bb55184c
commit 493d8027cd
2 changed files with 19 additions and 0 deletions

View File

@ -44,6 +44,10 @@ export async function init(editor) {
editor.actions.insertClipboardImages(clipboardImages, event.pageX, event.pageY);
}
},
// Handle dragover event to allow as drop-target in chrome
dragover: event => {
event.preventDefault();
},
// Handle image paste
paste: event => {
const clipboard = new Clipboard(event.clipboardData || event.dataTransfer);