mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -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 { deepClone, assign } from 'vs/base/common/objects';
|
||||||
import { Emitter, Event } from 'vs/base/common/event';
|
import { Emitter, Event } from 'vs/base/common/event';
|
||||||
import { equals } from 'vs/base/common/arrays';
|
import { equals } from 'vs/base/common/arrays';
|
||||||
|
import * as DOM from 'vs/base/browser/dom';
|
||||||
|
|
||||||
export class EditDataGridPanel extends GridParentComponent {
|
export class EditDataGridPanel extends GridParentComponent {
|
||||||
// The time(in milliseconds) we wait before refreshing the grid.
|
// The time(in milliseconds) we wait before refreshing the grid.
|
||||||
@@ -110,6 +111,7 @@ export class EditDataGridPanel extends GridParentComponent {
|
|||||||
onInit(): void {
|
onInit(): void {
|
||||||
const self = this;
|
const self = this;
|
||||||
this.baseInit();
|
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
|
// 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.
|
// 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
|
// Setup the state of the selected cell
|
||||||
this.resetCurrentCell();
|
this.resetCurrentCell();
|
||||||
this.currentEditCellValue = undefined;
|
|
||||||
this.removingNewRow = false;
|
this.removingNewRow = false;
|
||||||
this.newRowVisible = false;
|
this.newRowVisible = false;
|
||||||
this.dirtyCells = [];
|
this.dirtyCells = [];
|
||||||
@@ -522,7 +523,6 @@ export class EditDataGridPanel extends GridParentComponent {
|
|||||||
// so clear any existing client-side edit and refresh on-screen data
|
// 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.
|
// do not refresh the whole dataset as it will move the focus away to the first row.
|
||||||
//
|
//
|
||||||
this.currentEditCellValue = undefined;
|
|
||||||
this.dirtyCells = [];
|
this.dirtyCells = [];
|
||||||
let row = this.currentCell.row;
|
let row = this.currentCell.row;
|
||||||
this.resetCurrentCell();
|
this.resetCurrentCell();
|
||||||
@@ -761,6 +761,7 @@ export class EditDataGridPanel extends GridParentComponent {
|
|||||||
isEditable: false,
|
isEditable: false,
|
||||||
isDirty: false
|
isDirty: false
|
||||||
};
|
};
|
||||||
|
this.currentEditCellValue = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
private setCurrentCell(row: number, column: number) {
|
private setCurrentCell(row: number, column: number) {
|
||||||
|
|||||||
Reference in New Issue
Block a user