-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drop event should not bubble up if the image was uploaded #2837
Comments
cc @oleq |
…led. Closes ckeditor/ckeditor5-upload#92.
…he `clipboardInput` event is handled correctly. See ckeditor/ckeditor5-upload#92.
Fix: The DOM `drop` event will not bubble up if the `clipboardInput` event was handled. Closes ckeditor/ckeditor5-upload#92.
Tests: Added assertion to the `ImageUploadEditing` tests to make sure the `clipboardInput` event is handled correctly. See ckeditor/ckeditor5-upload#92.
@zadam Would you mind sharing how you achieved the generic file upload mechanism? Are you disregarding CKEditor's handing entirely, or did you somehow hook into it with a plugin? |
@patrikrazem, you can find a guide about creating custom image upload adapter on our documentation page. |
@Mgsy Thank you, but I've already implemented a custom image upload adapter and it works as expected. What I'm now trying to do is handle uploads of all file types (documents, pdfs, etc.) and then insert them into the content as anchor tags. |
@patrikrazem It's pretty simple, I have a div element on which I have event listener for In this particular case the div is parent of CKEditor so images are handled by CKEditor upload, but other file types bubble up and are uploaded using the uploaded described above (with no CKEditor involvement). |
I implemented custom image uploader plugin/adapter which allows user to drag & drop images into the text content which then uploads them the server and inserts them at the caret. This works well.
But I also have a custom drop DIV which allows upload of any type of file attachment. CKEditor is inside this DIV since I want to allow dropping attachments on large portion of the app. The way I image it should work is:
This kind of works, except for the fact that in the scenario 1), CKEditor doesn't stop the event propagation even though the event has been handled (image has been uploaded). Result of this is then that I get two uploads of the file.
In the image upload plugin infrastructure I can't see a way how to stop the propagation myself, since I don't have access to the original event AFAICS.
The text was updated successfully, but these errors were encountered: