From aabb7d3074c77080f2e0921a75118547ae1122e4 Mon Sep 17 00:00:00 2001 From: neodk2004 Date: Fri, 14 Aug 2026 20:18:47 +0200 Subject: [PATCH] fix(post-detail): center carousel images of different sizes vertically MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Regression from today's earlier "fill + object-contain" rework: fixing that removed CarouselItem's flex items-center/justify-center, which is what centered images in the carousel — because the shadcn Carousel primitive's inner ref div (src/components/ui/carousel.tsx) never gets an explicit height (its outer wrapper is hardcoded to just "overflow-hidden", no className passthrough), the img's h-full never resolves to anything definite there, so object-contain silently falls back to the image's natural aspect-ratio sizing instead of fill+letterbox+center. Without items-center, a shorter image among differently-sized carousel images just sat flush at the top of the (taller, shared) row instead of centered. The single-image path was unaffected — its container chain does resolve to a definite height, so object-contain there works as intended. --- src/components/feed/PostDetailDialog.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/feed/PostDetailDialog.tsx b/src/components/feed/PostDetailDialog.tsx index 6b387be..e691bf7 100644 --- a/src/components/feed/PostDetailDialog.tsx +++ b/src/components/feed/PostDetailDialog.tsx @@ -267,7 +267,7 @@ export function PostDetailDialog({ post, open, onClose, onDeleted }: PostDetailD {images.map((img) => ( - +