Skip to content
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

D&D upload doesn't work for the entire document when upload command is disabled #5149

Closed
oskarwrobel opened this issue May 25, 2018 · 2 comments · Fixed by ckeditor/ckeditor5-image#209
Assignees
Labels
package:image type:bug This issue reports a buggy (incorrect) behavior.
Milestone

Comments

@oskarwrobel
Copy link
Contributor

When selection is in the place where upload is not allowed then d&d upload does not work for the entire document.

Let's assume that image is not allowed in blockquote and upload command is disabled when selection is in blockquote element. Toolbar upload icon should be disabled then, but it should be possible to drop and upload image out of the blockquote.

@pjasiun
Copy link

pjasiun commented May 25, 2018

Unfortunately, I think we do our best to use target position, see insertAt in: https://github.com/ckeditor/ckeditor5-image/blob/076591e7f3b2eda73d172d6dcbabf8de3972aeba/src/imageupload/imageuploadediting.js#L63

The problem is the browser which, in many cases, do not bring the proper position.

This is why I am not sure if image upload should use image upload command. It should work the same way paste works: at this point do not use any command (in the future posibly use clipboard command). This way image paste will be handled the same way paste is handled, might be executed in places where the image command is disabled and moved later to the betters place like in the case of paste (use insertContent?). It will be disabled when clipboard will be disabled.

In make sense, especially when you think about pasting an image from HTML. The same rule should be applied when you paste <p><img></p> (or even a single <img>) and when you paste the image as a file.

@oskarwrobel
Copy link
Contributor Author

Unfortunately, I think we do our best to use target position, see insertAt in:
The problem is the browser which, in many cases, do not bring the proper position.

We can try to work around this by setting model selection to insertAt position before executing the command.

@oskarwrobel oskarwrobel self-assigned this May 30, 2018
Reinmar referenced this issue in ckeditor/ckeditor5-image Jun 4, 2018
Fix: Made image upload by drag&drop work when the `ImageUploadCommand` is disabled. Closes #208.
@mlewand mlewand transferred this issue from ckeditor/ckeditor5-image Oct 9, 2019
@mlewand mlewand added this to the iteration 18 milestone Oct 9, 2019
@mlewand mlewand added status:confirmed type:bug This issue reports a buggy (incorrect) behavior. package:image labels Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:image type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants