Skip to content

Commit

Permalink
Fix resize bug dragging from 0 px width in RelalizationNumberDisplay
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgenherje committed Nov 7, 2024
1 parent 928ba1c commit 1c4b3dd
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,11 @@ export const RealizationNumberDisplay: React.FC<RealizationNumberDisplayProps> =
const remainder = candidateNumberOfRealizationsPerRow % 5;
const newNumberOfRealizationsPerRow =
remainder === 0 ? candidateNumberOfRealizationsPerRow : candidateNumberOfRealizationsPerRow - remainder;
const validNumberOfRealizationsPerRow = Math.max(1, newNumberOfRealizationsPerRow);

return (
<div ref={divRef}>
{createRealizationNumberVisualization(props.showAsCompact ?? false, newNumberOfRealizationsPerRow)}
{createRealizationNumberVisualization(props.showAsCompact ?? false, validNumberOfRealizationsPerRow)}
</div>
);
};

0 comments on commit 1c4b3dd

Please sign in to comment.