mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
change the trigger of inputbox commit event (#18776)
This commit is contained in:
@@ -10,7 +10,6 @@ import { IContextViewProvider } from 'vs/base/browser/ui/contextview/contextview
|
|||||||
import { KeyCode } from 'vs/base/common/keyCodes';
|
import { KeyCode } from 'vs/base/common/keyCodes';
|
||||||
import * as DOM from 'vs/base/browser/dom';
|
import * as DOM from 'vs/base/browser/dom';
|
||||||
import { Dropdown } from 'sql/base/browser/ui/editableDropdown/browser/dropdown';
|
import { Dropdown } from 'sql/base/browser/ui/editableDropdown/browser/dropdown';
|
||||||
import { debounce } from 'vs/base/common/decorators';
|
|
||||||
import { Event } from 'vs/base/common/event';
|
import { Event } from 'vs/base/common/event';
|
||||||
import { Disposable } from 'vs/base/common/lifecycle';
|
import { Disposable } from 'vs/base/common/lifecycle';
|
||||||
|
|
||||||
@@ -69,7 +68,7 @@ export class TableCellEditorFactory {
|
|||||||
self._options.editorStyler(this._input);
|
self._options.editorStyler(this._input);
|
||||||
this._input.element.style.height = '100%';
|
this._input.element.style.height = '100%';
|
||||||
this._input.focus();
|
this._input.focus();
|
||||||
this._input.onDidChange(async () => {
|
this._input.onLoseFocus(async () => {
|
||||||
await this.commitEdit();
|
await this.commitEdit();
|
||||||
});
|
});
|
||||||
this._register(this._input);
|
this._register(this._input);
|
||||||
@@ -78,7 +77,6 @@ export class TableCellEditorFactory {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
@debounce(200)
|
|
||||||
private async commitEdit(): Promise<void> {
|
private async commitEdit(): Promise<void> {
|
||||||
if (this.isValueChanged()) {
|
if (this.isValueChanged()) {
|
||||||
const item = this._args.grid.getDataItem(this._args.grid.getActiveCell().row);
|
const item = this._args.grid.getDataItem(this._args.grid.getActiveCell().row);
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ import { alert } from 'vs/base/browser/ui/aria/aria';
|
|||||||
import { layoutDesignerTable, TableHeaderRowHeight, TableRowHeight } from 'sql/workbench/browser/designer/designerTableUtil';
|
import { layoutDesignerTable, TableHeaderRowHeight, TableRowHeight } from 'sql/workbench/browser/designer/designerTableUtil';
|
||||||
import { Dropdown, IDropdownStyles } from 'sql/base/browser/ui/editableDropdown/browser/dropdown';
|
import { Dropdown, IDropdownStyles } from 'sql/base/browser/ui/editableDropdown/browser/dropdown';
|
||||||
import { IListStyles } from 'vs/base/browser/ui/list/listWidget';
|
import { IListStyles } from 'vs/base/browser/ui/list/listWidget';
|
||||||
import { debounce } from 'vs/base/common/decorators';
|
|
||||||
|
|
||||||
export interface IDesignerStyle {
|
export interface IDesignerStyle {
|
||||||
tabbedPanelStyles?: ITabbedPanelStyles;
|
tabbedPanelStyles?: ITabbedPanelStyles;
|
||||||
@@ -723,11 +722,9 @@ export class Designer extends Disposable implements IThemable {
|
|||||||
ariaLabel: inputProperties.title,
|
ariaLabel: inputProperties.title,
|
||||||
type: inputProperties.inputType,
|
type: inputProperties.inputType,
|
||||||
});
|
});
|
||||||
input.onDidChange(() => {
|
input.onLoseFocus((args) => {
|
||||||
// The supress edit processing check is done in the handleEdit method, but since we have debounce operation on input box we
|
if (args.hasChanged) {
|
||||||
// have to do it here to avoid treating system originated value setting operation as user edits.
|
this.handleEdit({ type: DesignerEditType.Update, path: propertyPath, value: args.value, source: view });
|
||||||
if (!this._supressEditProcessing) {
|
|
||||||
this.handleInputBoxEdit({ type: DesignerEditType.Update, path: propertyPath, value: input.value, source: view });
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
input.onInputFocus(() => {
|
input.onInputFocus(() => {
|
||||||
@@ -944,11 +941,6 @@ export class Designer extends Disposable implements IThemable {
|
|||||||
return component;
|
return component;
|
||||||
}
|
}
|
||||||
|
|
||||||
@debounce(200)
|
|
||||||
private handleInputBoxEdit(edit: DesignerEdit) {
|
|
||||||
this.handleEdit(edit);
|
|
||||||
}
|
|
||||||
|
|
||||||
private startLoading(message: string, timeout: number): void {
|
private startLoading(message: string, timeout: number): void {
|
||||||
this._loadingTimeoutHandle = setTimeout(() => {
|
this._loadingTimeoutHandle = setTimeout(() => {
|
||||||
this._loadingSpinner.loadingMessage = message;
|
this._loadingSpinner.loadingMessage = message;
|
||||||
|
|||||||
Reference in New Issue
Block a user