mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-23 01:25:38 -05:00
Fix for revert on pressing escape. (#9090)
* added working revert * set currentEditCellValue to undefined * Some consolidation
This commit is contained in:
@@ -33,6 +33,7 @@ import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { deepClone, assign } from 'vs/base/common/objects';
|
||||
import { Emitter, Event } from 'vs/base/common/event';
|
||||
import { equals } from 'vs/base/common/arrays';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
|
||||
export class EditDataGridPanel extends GridParentComponent {
|
||||
// The time(in milliseconds) we wait before refreshing the grid.
|
||||
@@ -110,6 +111,7 @@ export class EditDataGridPanel extends GridParentComponent {
|
||||
onInit(): void {
|
||||
const self = this;
|
||||
this.baseInit();
|
||||
this._register(DOM.addDisposableListener(this.nativeElement, DOM.EventType.KEY_DOWN, e => this.tryHandleKeyEvent(new StandardKeyboardEvent(e))));
|
||||
|
||||
// Add the subscription to the list of things to be disposed on destroy, or else on a new component init
|
||||
// may get the "destroyed" object still getting called back.
|
||||
@@ -396,7 +398,6 @@ export class EditDataGridPanel extends GridParentComponent {
|
||||
|
||||
// Setup the state of the selected cell
|
||||
this.resetCurrentCell();
|
||||
this.currentEditCellValue = undefined;
|
||||
this.removingNewRow = false;
|
||||
this.newRowVisible = false;
|
||||
this.dirtyCells = [];
|
||||
@@ -522,7 +523,6 @@ export class EditDataGridPanel extends GridParentComponent {
|
||||
// so clear any existing client-side edit and refresh on-screen data
|
||||
// do not refresh the whole dataset as it will move the focus away to the first row.
|
||||
//
|
||||
this.currentEditCellValue = undefined;
|
||||
this.dirtyCells = [];
|
||||
let row = this.currentCell.row;
|
||||
this.resetCurrentCell();
|
||||
@@ -761,6 +761,7 @@ export class EditDataGridPanel extends GridParentComponent {
|
||||
isEditable: false,
|
||||
isDirty: false
|
||||
};
|
||||
this.currentEditCellValue = undefined;
|
||||
}
|
||||
|
||||
private setCurrentCell(row: number, column: number) {
|
||||
|
||||
Reference in New Issue
Block a user