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

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

Closed
carolinan opened this issue May 31, 2024 · 3 comments · Fixed by #62182
Assignees
Labels
[Block] Media & Text Affects the Media & Text Block Good First Issue An issue that's suitable for someone looking to contribute for the first time [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@carolinan
Copy link
Contributor

Description

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:

.wp-block-media-text.is-image-fill .wp-block-media-text__media img {
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

Step-by-step reproduction instructions

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

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@carolinan carolinan added [Type] Bug An existing feature does not function as intended [Block] Media & Text Affects the Media & Text Block labels May 31, 2024
@t-hamano
Copy link
Contributor

I think this issue should be resolved by adding > to the relevant CSS selectors.

The CSS specificity will remain the same, so there should be no impact on backwards compatibility. This approach should also resolve #62047.

image

@t-hamano t-hamano added the Good First Issue An issue that's suitable for someone looking to contribute for the first time label May 31, 2024
@narenin
Copy link
Contributor

narenin commented May 31, 2024

@t-hamano I am working on this.

@narenin
Copy link
Contributor

narenin commented May 31, 2024

@t-hamano I have fixed this in PR please check.

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 Good First Issue An issue that's suitable for someone looking to contribute for the first time [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
3 participants