From 4684aa05850e3bdbd93ec8a58e769eda89979a8e Mon Sep 17 00:00:00 2001 From: jorgenherje Date: Thu, 7 Nov 2024 08:58:51 +0100 Subject: [PATCH] Fix resize bug dragging from 0 px width in RelalizationNumberDisplay --- .../private-components/realizationNumberDisplay.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/framework/internal/components/EnsembleRealizationFilter/private-components/realizationNumberDisplay.tsx b/frontend/src/framework/internal/components/EnsembleRealizationFilter/private-components/realizationNumberDisplay.tsx index 8439ab57b..5d4bdc6ed 100644 --- a/frontend/src/framework/internal/components/EnsembleRealizationFilter/private-components/realizationNumberDisplay.tsx +++ b/frontend/src/framework/internal/components/EnsembleRealizationFilter/private-components/realizationNumberDisplay.tsx @@ -99,8 +99,9 @@ export const RealizationNumberDisplay: React.FC = const nonCompactWidthAndHeightPx = 12; // Find the number of realizations that can fit in a row based on non-compact size, as factor of 5 - const candidateNumberOfRealizationsPerRow = Math.floor( - divSize.width / (nonCompactWidthAndHeightPx + nonCompactGapPx) + const candidateNumberOfRealizationsPerRow = Math.max( + 5, + Math.floor(divSize.width / (nonCompactWidthAndHeightPx + nonCompactGapPx)) ); const remainder = candidateNumberOfRealizationsPerRow % 5; const newNumberOfRealizationsPerRow =