Skip to content

Commit

Permalink
FIO-4235 Fixed more cases when confirmation dialog wasn't showing up …
Browse files Browse the repository at this point in the history
…for EditGrid
  • Loading branch information
antonSoftensity committed Dec 1, 2023
1 parent 5f3f593 commit 2e752d0
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 (_.isNil(editRow.backup) || _.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 2e752d0

Please sign in to comment.