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

Update: Image Block: Change image by drag & drop an image from the desktop #14983

Conversation

jorgefilipecosta
Copy link
Member

@jorgefilipecosta jorgefilipecosta commented Apr 15, 2019

This PR allows images to dragged into the image block that already contains an image. The new image is uploaded and replace the previous one.

cc: @mtias

How has this been tested?

I added an image block; I selected an image from the media gallery.
I dragged an image from the desktop to the image block created on the previous point.
I verified the image was changed.

Copy link
Contributor

@draganescu draganescu left a comment

works as advertised! :)

@draganescu
Copy link
Contributor

draganescu commented May 1, 2019

Awesome update @jorgefilipecosta! Once this #14918 gets approved (by a review) I could add this behaviour to the gallery, media + text, cover, audio, vide and file blocks. Do you think it's ok to enable drag and drop there too?

@jorgefilipecosta jorgefilipecosta merged commit 6552706 into master May 1, 2019
1 check passed
@jorgefilipecosta jorgefilipecosta deleted the update/allow-change-image-on-the-image-block-by-dragging-an-image-into-the-block branch May 1, 2019
@jorgefilipecosta
Copy link
Member Author

jorgefilipecosta commented May 1, 2019

Thank you for the review @draganescu 👍

I could add this behaviour to the gallery, media + text, cover, audio, vide and file blocks. Do you think it's ok to enable drag and drop there too?

The gallery block already has drag & drop behavior, it appends the dragged images to the gallery, I guess we can leave that behavior.
The cover blocks contain nesting, when we drag an image to a nested area it adds new image block (or gallery) inside that area. Adding drag & drop behavior would collide with the nesting behavior and the result may be uncertain.
The media text also contains nesting but the media element is at the side so I think drag & drop would work well there, and it makes sense to add.
For audio, video and file blocks, it seems like drag & drop to replace totally makes sense, and I'm predicting any potential issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants