Skip to content

Commit

Permalink
fix: large post placeholder width regression, failing naturally sized…
Browse files Browse the repository at this point in the history
… media
  • Loading branch information
aeharding committed Nov 24, 2024
1 parent ebbb5b5 commit e70add5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/features/media/MediaPlaceholder.module.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
.placeholderContainer {
display: flex;

/* Sometimes the <img> natural size is loaded, but the media cannot be played */
overflow: hidden;

&:global(.not-loaded) {
align-items: center;
justify-content: center;
Expand Down
3 changes: 2 additions & 1 deletion src/features/post/inFeed/large/media/LargeFeedPostMedia.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { ComponentProps } from "react";

import LargeFeedRedgifMedia from "#/features/media/external/redgifs/LargeFeedRedgifMedia";
import { isRedgif } from "#/features/media/external/redgifs/helpers";
import { cx } from "#/helpers/css";

import usePostSrc from "../../usePostSrc";
import LargeFeedMedia from "./LargeFeedMedia";
Expand Down Expand Up @@ -33,7 +34,7 @@ export default function LargeFeedPostMedia(
src={src}
autoPlay={!props.blur}
alt={props.post.post.alt_text}
className={styles.lightbox}
className={cx(styles.lightbox, props.className)}
shouldPortal
/>
);
Expand Down

0 comments on commit e70add5

Please sign in to comment.