From 645926ca83a0f70566ad80d48f0b7bb55970bff3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Jos=C3=A9=20dos=20Santos?= Date: Thu, 18 Apr 2024 15:12:10 -0300 Subject: [PATCH] no-issue#: Fixes iterator expression and nested iterator expression. --- .../IteratorExpressionComponent.tsx | 2 +- .../src/resizing/WidthMaths.ts | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/packages/boxed-expression-component/src/expressions/IteratorExpression/IteratorExpressionComponent.tsx b/packages/boxed-expression-component/src/expressions/IteratorExpression/IteratorExpressionComponent.tsx index 86d118fe2a6..d56b1d51780 100644 --- a/packages/boxed-expression-component/src/expressions/IteratorExpression/IteratorExpressionComponent.tsx +++ b/packages/boxed-expression-component/src/expressions/IteratorExpression/IteratorExpressionComponent.tsx @@ -219,7 +219,7 @@ export function IteratorExpressionComponent({ /> ); - } else if (props.rowIndex === 2 || props.rowIndex === 3) { + } else if (props.rowIndex === 1 || props.rowIndex === 2) { return ( getExpressionMinWidth(e))) + + ITERATOR_EXPRESSION_EXTRA_WIDTH + ); + } + + // Every/Some + else if (expression.__$$element === "every" || expression.__$$element === "some") { + const nestedExpressions = [expression.in.expression, expression.satisfies.expression]; + return ( + ITERATOR_EXPRESSION_LABEL_COLUMN_WIDTH + + Math.max(ITERATOR_EXPRESSION_CLAUSE_COLUMN_MIN_WIDTH, ...nestedExpressions.map((e) => getExpressionMinWidth(e))) + + ITERATOR_EXPRESSION_EXTRA_WIDTH + ); + } // Others else { throw new Error("Shouldn't ever reach this point");