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

Fixed Media Text Block Issue : When crop image to fill is enabled, the image in nested media & text blocks does not show #62182

Merged
merged 2 commits into from
Jun 1, 2024

Conversation

narenin
Copy link
Contributor

@narenin narenin commented May 31, 2024

What?

Fix: #62166
When the media & text block has an image (or featured image), and the setting "Crop image to fill" is enabled,
and another media & text block is added in the content area, the image of that second media & text block is hidden. It is hidden by the CSS from the first (outer) media & text block.

Why?

This will fixed the issue which occur when crop image to fill is enabled, the image in nested media & text blocks.

How?

I have resolved this by adding > to the relevant CSS selectors.

Testing Instructions

  1. Add a media and text block and select an image as the media.
  2. In the block settings panel, enable "crop image to fill".
  3. Add another media & text block inside. Try to select an image.
  4. Confirm that the image is hidden in the editor and the front.

@narenin narenin requested a review from ajitbohra as a code owner May 31, 2024 12:03
Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: narenin <narenin@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: carolinan <poena@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@narenin narenin changed the title Fixed Media Text Block Issue Fixed Media Text Block Issue : When crop image to fill is enabled, the image in nested media & text blocks does not show May 31, 2024
Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

To be on the safe side, I think it's better to apply this approach to all selectors that have the .is-image-fill class, which should be three in total.

@narenin
Copy link
Contributor Author

narenin commented May 31, 2024

@t-hamano Thanks for the feedback. I have implemented the suggestions, please check.

@t-hamano t-hamano self-requested a review June 1, 2024 01:55
Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

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

LGTM!

Before

image

After

image

@t-hamano t-hamano self-assigned this Jun 1, 2024
@t-hamano t-hamano added [Type] Bug An existing feature does not function as intended [Block] Media & Text Affects the Media & Text Block labels Jun 1, 2024
@t-hamano t-hamano merged commit ceb8949 into WordPress:trunk Jun 1, 2024
65 of 66 checks passed
@github-actions github-actions bot added this to the Gutenberg 18.6 milestone Jun 1, 2024
carstingaxion pushed a commit to carstingaxion/gutenberg that referenced this pull request Jun 4, 2024
…e image in nested media & text blocks does not show (WordPress#62182)

* Fixed Media Text Block Issue

* Implemented the suggestions

Co-authored-by: narenin <narenin@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: carolinan <poena@git.wordpress.org>
@ellatrix
Copy link
Member

ellatrix commented Jun 7, 2024

Should this be backported for WP 6.6? If so, please add the Backport to WP Beta/RC label. Thanks!

@t-hamano
Copy link
Contributor

t-hamano commented Jun 8, 2024

This issue isn't new to WP6.6, but I think it's a great fix, so let's backport it to WP6.6.

@t-hamano t-hamano added the Backport to WP 6.6 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Jun 8, 2024
ellatrix pushed a commit that referenced this pull request Jun 11, 2024
…e image in nested media & text blocks does not show (#62182)

* Fixed Media Text Block Issue

* Implemented the suggestions

Co-authored-by: narenin <narenin@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: carolinan <poena@git.wordpress.org>
ellatrix pushed a commit that referenced this pull request Jun 11, 2024
…e image in nested media & text blocks does not show (#62182)

* Fixed Media Text Block Issue

* Implemented the suggestions

Co-authored-by: narenin <narenin@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: carolinan <poena@git.wordpress.org>
patil-vipul pushed a commit to patil-vipul/gutenberg that referenced this pull request Jun 17, 2024
…e image in nested media & text blocks does not show (WordPress#62182)

* Fixed Media Text Block Issue

* Implemented the suggestions

Co-authored-by: narenin <narenin@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: carolinan <poena@git.wordpress.org>
@ellatrix ellatrix removed the Backport to WP 6.6 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Jun 18, 2024
@ellatrix
Copy link
Member

This was cherry-picked to the wp/6.6 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Media & Text Affects the Media & Text Block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Media & Text: When crop image to fill is enabled, the image in nested media & text blocks does not show
3 participants