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

Why is the upload button enabled when the image is selected? #5160

Closed
oleq opened this issue Jul 17, 2018 · 2 comments · Fixed by ckeditor/ckeditor5-image#228
Closed

Why is the upload button enabled when the image is selected? #5160

oleq opened this issue Jul 17, 2018 · 2 comments · Fixed by ckeditor/ckeditor5-image#228
Labels
package:image status:discussion type:question This issue asks a question (how to...).
Milestone

Comments

@oleq
Copy link
Member

oleq commented Jul 17, 2018

The enabled button suggests that some action (?) in the context of the selected image can be performed. But clicking it only uploads another image next to the selected one.

It could be confusing IMO.

image

cc @dkonopka

@pjasiun
Copy link

pjasiun commented Sep 24, 2018

I believe it should be consistent.

At the moment, if an object is selected, the image will be inserted after that object (note that image is not inserted in the position of the selection, but it uses findOptimalInsertionPosition util). If we decide that the button should be disabled on such a position, the command should do nothing. If we disable the button, but command.execute will still execute its action (and insert image after) it will be strange.

Also, I think that this behavior should not be limited to the image. I think it should work like this for inserting images on all objects, or even more generic, for inserting all objects (which uses findOptimalInsertionPosition) when an object is selected. So whenever an object is selected and I want to insert an object the button should be disabled.

Alternatively, we could replace one object with the other in such cases.

@jodator
Copy link
Contributor

jodator commented Sep 24, 2018

f we disable the button, but command.execute will still execute its action (and insert image after) it will be strange.

Actually the proposition is to disable command not the button so the command.execute() will not insert image. But yes - we should agree on how it will work.

jodator referenced this issue in ckeditor/ckeditor5-image Sep 28, 2018
Other: The ImageUploadCommand should check whether it can be executed in the selection context. Closes #225. Closes #227. Closes #235.

BREAKING CHANGE: The `options.file` property was renamed to options.files for 'imageUpload' command.
BREAKING CHANGE: The `options.insertAt` property for 'imageUpload' command was removed. The command will now use model's selection.
@mlewand mlewand transferred this issue from ckeditor/ckeditor5-image Oct 9, 2019
@mlewand mlewand added this to the iteration 20 milestone Oct 9, 2019
@mlewand mlewand added module:ux status:discussion type:question This issue asks a question (how to...). 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 status:discussion type:question This issue asks a question (how to...).
Projects
None yet
4 participants