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

Fix: Image block does not retain the dimensions when opening the media library #16125

Conversation

jorgefilipecosta
Copy link
Member

Fixes: #9737

Currently, in the image block, if we open the media library and we select the same image the "Image Size" (URL) and the dimensions are reset.
It seems after the upload some users may first select the desired size and then open the media library to change the media object itself (and not just the block) and add alt, description, etc. Doing this resets the choose image size. This PR fixes that problem.

How has this been tested?

I upload an image, I changed the dimensions using the resizer. I pressed the change image button, I opened the media library and I changed the caption of the image. I verified the new caption was applied and the dimensions were kept.
I repeated the test but instead of changing dimensions I changed the "Image Size" option of the image to "Full Image".

@jorgefilipecosta jorgefilipecosta added [Type] Bug An existing feature does not function as intended [Feature] Media Anything that impacts the experience of managing media [Block] Image Affects the Image Block labels Jun 12, 2019
@jorgefilipecosta jorgefilipecosta changed the title Fix: Image block does not retain the dimensions when opening the medi… Fix: Image block does not retain the dimensions when opening the media library Jun 13, 2019
Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

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

Makes sense, could use an e2e or unit test maybe.

@jorgefilipecosta jorgefilipecosta force-pushed the fix/image-block-does-not-retain-the-dimensions-when-opening-the-media-library branch from 655285d to 23c6e76 Compare July 4, 2019 14:04
@jorgefilipecosta jorgefilipecosta force-pushed the fix/image-block-does-not-retain-the-dimensions-when-opening-the-media-library branch from 23c6e76 to 675fb0e Compare July 4, 2019 16:10
@jorgefilipecosta jorgefilipecosta merged commit bb50415 into master Jul 4, 2019
@jorgefilipecosta jorgefilipecosta deleted the fix/image-block-does-not-retain-the-dimensions-when-opening-the-media-library branch July 4, 2019 17:32
@jorgefilipecosta
Copy link
Member Author

I added a unit test before the merge 👍

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] Media Anything that impacts the experience of managing media [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Image block doesn't retain a chosen image size after using the Edit button to add alt text etc
2 participants