From 0a16bb2fbabbf09ee9db5821c6594c825dfb507c Mon Sep 17 00:00:00 2001 From: Athou Date: Fri, 29 Nov 2024 13:30:48 +0100 Subject: [PATCH] if width is specified, keep images aspect ratio (#1595) --- .../src/components/ImageWithPlaceholderWhileLoading.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/commafeed-client/src/components/ImageWithPlaceholderWhileLoading.tsx b/commafeed-client/src/components/ImageWithPlaceholderWhileLoading.tsx index 49c51d60..2b219611 100644 --- a/commafeed-client/src/components/ImageWithPlaceholderWhileLoading.tsx +++ b/commafeed-client/src/components/ImageWithPlaceholderWhileLoading.tsx @@ -70,7 +70,11 @@ export function ImageWithPlaceholderWhileLoading({ width={width} height={height} onLoad={() => setLoading(false)} - style={{ ...style, display: loading ? "none" : (style?.display ?? "initial") }} + style={{ + ...style, + display: loading ? "none" : (style?.display ?? "initial"), + height: style?.width ? "auto" : style?.height, + }} /> )