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 Block: Image not rendered properly on frontend when inside stack #68609

Open
3 of 6 tasks
Mayank-Tripathi32 opened this issue Jan 10, 2025 · 1 comment · May be fixed by #68610
Open
3 of 6 tasks

Media & Text Block: Image not rendered properly on frontend when inside stack #68609

Mayank-Tripathi32 opened this issue Jan 10, 2025 · 1 comment · May be fixed by #68610
Assignees
Labels
[Block] Media & Text Affects the Media & Text Block [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@Mayank-Tripathi32
Copy link
Contributor

Mayank-Tripathi32 commented Jan 10, 2025

Description

When a Media Text block is created within a stack and an image is added without accompanying text, the block renders correctly in the editor. However, on the frontend, it is rendered without a defined width, causing the image to be hidden.

Expected Behavior

The image should be rendered with an appropriate width, making it visible on the frontend, even if no text is present.

Actual Behavior

The image is rendered without a defined width, causing it to be hidden on the frontend.

Please Note

I am working on the issue, discovered while working on #65605. Only happens with block themes.

Step-by-step reproduction instructions

  1. Add a Media Text block inside a Stack block.
  2. Upload or select an image for the Media Text block.
  3. Leave the text field empty and Enable crop to fit.
  4. Preview the frontend of the page.

Screenshots, screen recording, code snippet

Frontend

Image

Editor

Image

Environment info

WordPress version: 6.7
Browser(s): Safari, Chrome
OS: MAC

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

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure
@Mayank-Tripathi32 Mayank-Tripathi32 added the [Type] Bug An existing feature does not function as intended label Jan 10, 2025
@Mayank-Tripathi32
Copy link
Contributor Author

I will be opening a PR to fix the issue.

@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Jan 10, 2025
@t-hamano t-hamano added the [Block] Media & Text Affects the Media & Text Block label Jan 11, 2025
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 [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
2 participants