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 crop glitch #27320

Closed
wants to merge 2 commits into from

Conversation

stokesman
Copy link
Contributor

@stokesman stokesman commented Nov 27, 2020

Intended to fix #27145 without regressing #23986. Noticing that the cropping glitch does not affect aligned Image blocks that have been resized, I updated the selector for applying the table display so it wouldn't match non-resized image blocks (leaving their display as block).

There are two commits here. The first alone is enough for the fix. The second commit could be dropped from this PR but was made in the interest of being sure there are no style changes on the frontend from #26376. It undoes a removal in 990ba5a while replicating its intended effect in the editor with an override in editor.scss instead.

How has this been tested?

  1. add an image block
  2. set its alignment to left, center, or right
  3. press crop in the toolbar
  4. notice the image remains the same size
  5. cancel the image editing mode
  6. unset the alignment
  7. resize the image with the drag handles
  8. note the image stays in the default alignment (does not center)

Types of changes

Bug fix

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR.

@stokesman stokesman marked this pull request as ready for review November 27, 2020 18:31
@stokesman stokesman requested a review from ajlende as a code owner November 27, 2020 18:31
@stokesman stokesman changed the title Fix: image crop glitch Fix Image block crop glitch Nov 27, 2020
Styles the image and caption in editor with table display only
when the block is both aligned and resized.
And uses an override in editor styles to get the desired alignment
in that context
@stokesman stokesman force-pushed the fix/image-crop-glitch branch from 4ebdcd8 to a3e53f9 Compare November 29, 2020 21:39
@skorasaurus skorasaurus added the [Block] Image Affects the Image Block label Dec 6, 2020
@draganescu draganescu added the [Type] Bug An existing feature does not function as intended label Dec 11, 2020
@stokesman stokesman closed this Jan 11, 2021
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 [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Image disappears when trying to crop
3 participants