Skip to content

Latest Posts: Fix video overflow in full content mode - #61538

Closed
amitraj2203 wants to merge 2 commits into
WordPress:trunkfrom
amitraj2203:fix/issue-61477
Closed

amitraj2203 wants to merge 2 commits into
WordPress:trunkfrom
amitraj2203:fix/issue-61477

Conversation

@amitraj2203

@amitraj2203 amitraj2203 commented May 9, 2024 •

Copy link
Copy Markdown
Contributor

What?

Fixes: #61477

Why?

It makes videos contained within the allocated space in the latest posts block by setting appropriate width. Fixes overflow and overlap issues when 'Show full post' option is enabled, preventing horizontal scroll bars.

How?

Enqueues the styles for video, cover and media-text block in Latest Posts block,

Testing Instructions

  1. Add a latests posts block
  2. Enable "Post content > Show full post" in the block settings panel of the latests post block.

Testing Instructions for Keyboard

NIL

Screenshots or screencast

image
image

@amitraj2203
amitraj2203 requested a review from ajitbohra as a code owner May 9, 2024 17:15
@github-actions

github-actions Bot commented May 9, 2024

Copy link
Copy Markdown

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: amitraj2203 <amitraj2203@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.

@carolinan

Copy link
Copy Markdown
Contributor

Hi, thank you for the PR. The proposed change loads all the CSS for the video, cover and media & text blocks even when they are not on the page, including all the CSS that is unrelated to the width of the video.
I think it would be more performant to only limit the width of the video as part of the CSS for the latest posts block.

@carolinan carolinan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Avoid loading the additional CSS when the inner blocks are not used, and limit the scope of the change to the width of videos.

@youknowriad

Copy link
Copy Markdown
Contributor

Thank you for working on this, @amitraj2203! The underlying issue turned out to be that blocks inside the Latest Posts full content weren't being parsed, which #74866 fixed. That also loads the needed block styles only when those blocks are present, and #61477 is now closed. I'm closing this PR as superseded, but please reopen it or open a new PR if you still see video overflow on trunk.

@youknowriad youknowriad closed this Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Latest Posts Affects the Latest Posts Block [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Latest Posts: When the full content option is used, videos are not contained and shows with the original width and height

4 participants