From 74e70b0062a00d0a6976cd15a72c4fe5fb39565e Mon Sep 17 00:00:00 2001 From: "ICX\\Tatsiana.Hashtold" Date: Mon, 9 Dec 2024 17:58:11 +0300 Subject: [PATCH] FIO-8862: fixed unnecessary redrawings of the value component in conditional ui --- src/components/editgrid/EditGrid.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/editgrid/EditGrid.js b/src/components/editgrid/EditGrid.js index 819cf1872d..7925300e61 100644 --- a/src/components/editgrid/EditGrid.js +++ b/src/components/editgrid/EditGrid.js @@ -344,13 +344,16 @@ export default class EditGridComponent extends NestedArrayComponent { checkRowVariableTypeComponents(editRow, rowIndex) { const rowComponents = editRow.components; + let typeChanged = false; if (_.some(this.variableTypeComponentsIndexes, (compIndex) => { const variableTypeComp = rowComponents[compIndex]; return variableTypeComp.type !== variableTypeComp.component.type; })) { editRow.components = this.createRowComponents(editRow.data, rowIndex, true); + typeChanged = true; } + return typeChanged; } setVariableTypeComponents() { @@ -1120,8 +1123,10 @@ export default class EditGridComponent extends NestedArrayComponent { } if (this.variableTypeComponentsIndexes.length) { - this.checkRowVariableTypeComponents(editRow, rowIndex); - this.redraw(); + const typeChanged = this.checkRowVariableTypeComponents(editRow, rowIndex); + if (typeChanged) { + this.redraw(); + } } };