From 5e9fed4124d4d9332737cc8b80256c8adaf31542 Mon Sep 17 00:00:00 2001 From: Fedor Katurov Date: Mon, 2 Dec 2019 12:41:46 +0700 Subject: [PATCH] fixed minimal image height --- src/components/node/NodeImageSlideBlock/index.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/node/NodeImageSlideBlock/index.tsx b/src/components/node/NodeImageSlideBlock/index.tsx index a971b181..7b1f7775 100644 --- a/src/components/node/NodeImageSlideBlock/index.tsx +++ b/src/components/node/NodeImageSlideBlock/index.tsx @@ -103,8 +103,10 @@ const NodeImageSlideBlock: FC = ({ node, is_loading, updateLayout }) => return () => clearTimeout(timeout); } - const prev = Math.max(heights[Math.floor(selected)] || fallback, fallback); - const next = Math.max(heights[Math.ceil(selected)] || fallback, fallback); + const minimal = Math.min(fallback, 120); + + const prev = Math.max(heights[Math.floor(selected)] || fallback, minimal); + const next = Math.max(heights[Math.ceil(selected)] || fallback, minimal); const now = prev - (prev - next) * (selected % 1); if (current !== Math.round(selected)) setCurrent(Math.round(selected));