Duplicate Significant layout shift on media item pages

Kirby

Well-known member
Licensed customer
Affected version
2.2.3

This might be caused by flexbox not being able to detetmine the height early enough; adding height and max-height CSS rules on div.media-container seems to fix this for me:

Code:
<xf:if is="$mediaItem.media_type === 'image'">
<xf:css>
div.media-container
{
    height: {$mediaItem.Attachment.Data.width}px;
    max-height: 80vh;
}
</xf:css>
</xf:if>
 
Automated triage: Duplicate

This layout shift on media item pages was addressed in XenForo Media Gallery 2.2.5, which reserves space for the image before it loads. You're running 2.2.3, so upgrading should resolve it.

Duplicate of: https://xenforo.com/community/threads/206907/

This is an automated assessment. A member of staff may review and update it.
 
Back
Top Bottom