Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Release/1.46] Fix Edit Data Revert for New Row. #24433

Merged
merged 1 commit into from
Sep 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,12 @@ export class EditDataGridPanel extends GridParentComponent {
// Prevent the cell submission function from being called multiple times.
private cellSubmitInProgress: boolean;

// Prevent the tab focus from doing any damage to the table while its being reverted.
// Prevent the tab focus from doing any damage to the table while a cell is being reverted.
private cellRevertInProgress: boolean;

// Prevent the tab focus from doing any damage to the table while a row is being reverted.
private rowRevertInProgress: boolean

// Manually submit the cell after edit end if it's the null row.
private isInNullRow: boolean;

Expand Down Expand Up @@ -343,7 +346,7 @@ export class EditDataGridPanel extends GridParentComponent {
// definition for the column (ie, the selection was reset)
// Also skip when cell updates are happening as we don't want to affect other cells while this is going on.
// (focus should shift back to current cell if it is set)
if (row === undefined || column === undefined || this.cellSubmitInProgress || this.cellRevertInProgress) {
if (row === undefined || column === undefined || this.cellSubmitInProgress || this.cellRevertInProgress || this.rowRevertInProgress) {
return;
}

Expand Down Expand Up @@ -626,6 +629,7 @@ export class EditDataGridPanel extends GridParentComponent {
// Private Helper Functions ////////////////////////////////////////////////////////////////////////////

private async revertCurrentRow(): Promise<void> {
this.rowRevertInProgress = true;
let currentNewRowIndex = this.dataSet.totalRows - 2;
if (this.newRowVisible && this.currentCell.row === currentNewRowIndex) {
// revert our last new row
Expand Down Expand Up @@ -664,6 +668,7 @@ export class EditDataGridPanel extends GridParentComponent {
}
}
}
this.rowRevertInProgress = false;
}

private async revertCurrentCell(): Promise<void> {
Expand Down