change the trigger of inputbox commit event (#18776)

This commit is contained in:
Alan Ren
2022-03-18 13:16:43 -07:00
committed by GitHub
parent 301c6f24fe
commit f2d4801634
2 changed files with 4 additions and 14 deletions

View File

@@ -10,7 +10,6 @@ import { IContextViewProvider } from 'vs/base/browser/ui/contextview/contextview
import { KeyCode } from 'vs/base/common/keyCodes';
import * as DOM from 'vs/base/browser/dom';
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 { Disposable } from 'vs/base/common/lifecycle';
@@ -69,7 +68,7 @@ export class TableCellEditorFactory {
self._options.editorStyler(this._input);
this._input.element.style.height = '100%';
this._input.focus();
this._input.onDidChange(async () => {
this._input.onLoseFocus(async () => {
await this.commitEdit();
});
this._register(this._input);
@@ -78,7 +77,6 @@ export class TableCellEditorFactory {
}));
}
@debounce(200)
private async commitEdit(): Promise<void> {
if (this.isValueChanged()) {
const item = this._args.grid.getDataItem(this._args.grid.getActiveCell().row);

View File

@@ -45,7 +45,6 @@ import { alert } from 'vs/base/browser/ui/aria/aria';
import { layoutDesignerTable, TableHeaderRowHeight, TableRowHeight } from 'sql/workbench/browser/designer/designerTableUtil';
import { Dropdown, IDropdownStyles } from 'sql/base/browser/ui/editableDropdown/browser/dropdown';
import { IListStyles } from 'vs/base/browser/ui/list/listWidget';
import { debounce } from 'vs/base/common/decorators';
export interface IDesignerStyle {
tabbedPanelStyles?: ITabbedPanelStyles;
@@ -723,11 +722,9 @@ export class Designer extends Disposable implements IThemable {
ariaLabel: inputProperties.title,
type: inputProperties.inputType,
});
input.onDidChange(() => {
// The supress edit processing check is done in the handleEdit method, but since we have debounce operation on input box we
// have to do it here to avoid treating system originated value setting operation as user edits.
if (!this._supressEditProcessing) {
this.handleInputBoxEdit({ type: DesignerEditType.Update, path: propertyPath, value: input.value, source: view });
input.onLoseFocus((args) => {
if (args.hasChanged) {
this.handleEdit({ type: DesignerEditType.Update, path: propertyPath, value: args.value, source: view });
}
});
input.onInputFocus(() => {
@@ -944,11 +941,6 @@ export class Designer extends Disposable implements IThemable {
return component;
}
@debounce(200)
private handleInputBoxEdit(edit: DesignerEdit) {
this.handleEdit(edit);
}
private startLoading(message: string, timeout: number): void {
this._loadingTimeoutHandle = setTimeout(() => {
this._loadingSpinner.loadingMessage = message;