Skip to content

Commit

Permalink
FIO-8862: fixed unnecessary redrawings of the value component in cond…
Browse files Browse the repository at this point in the history
…itional ui
  • Loading branch information
TanyaGashtold committed Dec 9, 2024
1 parent 05de554 commit 74e70b0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/editgrid/EditGrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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();
}
}
};

Expand Down

0 comments on commit 74e70b0

Please sign in to comment.