Skip to content

Commit

Permalink
FIO-4235 Fixed confirmation dialog popping up when the data is empty … (
Browse files Browse the repository at this point in the history
#5413)

* FIO-4235 Fixed confirmation dialog popping up when the data is empty in EditGrid

* FIO-4235 Fixed more cases when confirmation dialog wasn't showing up for EditGrid
  • Loading branch information
antonSoftensity authored Dec 8, 2023
1 parent 953050a commit 1f2b9b7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/editgrid/EditGrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,10 @@ export default class EditGridComponent extends NestedArrayComponent {
const rowIndex = this.editRows.length;
const editRow = this.createRow(dataObj, rowIndex);

if (editRow.state === EditRowState.New) {
this.emptyRow = fastCloneDeep(editRow.data);
}

if (this.inlineEditMode) {
this.triggerChange();
}
Expand Down Expand Up @@ -787,7 +791,7 @@ export default class EditGridComponent extends NestedArrayComponent {

showDialog(rowIndex) {
const editRow = this.editRows[rowIndex];
if (_.isEqual(editRow.backup, editRow.data)) {
if (editRow.state === EditRowState.New ? _.isEqual(this.emptyRow, editRow.data) : _.isEqual(editRow.backup, editRow.data)) {
return Promise.resolve();
}

Expand Down

0 comments on commit 1f2b9b7

Please sign in to comment.