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

Image disappears when trying to crop #27145

Closed
draganescu opened this issue Nov 20, 2020 · 6 comments · Fixed by #27687
Closed

Image disappears when trying to crop #27145

draganescu opened this issue Nov 20, 2020 · 6 comments · Fixed by #27687
Assignees
Labels
[Block] Image Affects the Image Block [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@draganescu
Copy link
Contributor

Describe the bug
While testing #27105 I found that when trying to crop an aligned image the image would disappear.

To reproduce

  • in a new post
  • add an image
  • set its alignment to right
  • select the image
  • press crop in the toolbar
  • notice the bug

Expected behavior
The image should not disappear.

Screenshots

align-crop

@draganescu draganescu added [Type] Bug An existing feature does not function as intended [Block] Image Affects the Image Block labels Nov 20, 2020
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Nov 27, 2020
@stokesman
Copy link
Contributor

I can confirm what I believe is the same bug except the image isn't disappearing but instead it shrinking drastically.

Screen recording of the issue on center aligned images

It does also happen on left or right aligned images.

While trying to figure this out, I gave reverting 1fbe105 a try and that worked to resolve this. Because #26376 was backported to WP 5.6 I'm pinging @tellthemachines and @talldan to see if they can test if this issue is occurring there. If it is, then please proceed to testing if #27320 is a proper fix🤞

@tellthemachines
Copy link
Contributor

I can reproduce this issue in 5.5.3. Given that it's not a 5.6 regression, it's not eligible to be included during RC stage.

@draganescu
Copy link
Contributor Author

@stokesman I added an alternative PR #27687 that does not change the CSS but instead uses clientWidth as the width of the cropper when 100% means zero px. I am unsure if this is a better fix, but it seems to be making a sort of defensive implementation in case more CSS results in 100% being zero px in the future.

@stokesman
Copy link
Contributor

Nice one Andrei, I'd taken a quick look toward that approach but didn't quickly find where to implement it. Seems the better way to me.

@draganescu
Copy link
Contributor Author

@stokesman I merged #27687 let's see if anything new pops up. I think #27320 can be closed?

@stokesman
Copy link
Contributor

Thanks for the reminder Andrei

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 [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
3 participants