Skip to content

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

Merged
jorgefilipecosta merged 1 commit intomasterfrom
update/allow-change-image-on-the-image-block-by-dragging-an-image-into-the-block
May 1, 2019
Merged

Update: Image Block: Change image by drag & drop an image from the desktop#14983
jorgefilipecosta merged 1 commit intomasterfrom
update/allow-change-image-on-the-image-block-by-dragging-an-image-into-the-block

Conversation

@jorgefilipecosta
Copy link
Copy Markdown
Member

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.

@jorgefilipecosta jorgefilipecosta added [Type] Enhancement A suggestion for improvement. [Block] Image Affects the Image Block labels Apr 15, 2019
@oandregal oandregal added the [Feature] Drag and Drop Drag and drop functionality when working with blocks label Apr 22, 2019
Copy link
Copy Markdown
Contributor

@draganescu draganescu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works as advertised! :)

@draganescu
Copy link
Copy Markdown
Contributor

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
@jorgefilipecosta jorgefilipecosta deleted the update/allow-change-image-on-the-image-block-by-dragging-an-image-into-the-block branch May 1, 2019 11:18
@jorgefilipecosta
Copy link
Copy Markdown
Member Author

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

Labels

[Block] Image Affects the Image Block [Feature] Drag and Drop Drag and drop functionality when working with blocks [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants