Make editable dropdowns emit value change events on type (#11970)

This commit is contained in:
Charles Gagnon
2020-08-27 14:52:20 -07:00
committed by GitHub
parent 9824118a07
commit bf278c39bd
2 changed files with 4 additions and 3 deletions

View File

@@ -50,6 +50,7 @@ export class EditableDropDown extends AngularDisposable implements OnInit, OnCha
this._selectbox = new Dropdown(this._el.nativeElement, this.contextViewService, dropdownOptions);
this._selectbox.values = this.options;
this._selectbox.value = this.selectedOption;
this._selectbox.fireOnTextChange = true;
this._selectbox.onValueChange(e => {
if (this.onlyEmitOnChange) {

View File

@@ -8,7 +8,7 @@ import {
Output, OnChanges, SimpleChanges, EventEmitter
} from '@angular/core';
import { SelectBox as vsSelectBox } from 'sql/base/browser/ui/selectBox/selectBox';
import { SelectBox as sqlSelectBox } from 'sql/base/browser/ui/selectBox/selectBox';
import { AngularDisposable } from 'sql/base/browser/lifecycle';
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
@@ -21,7 +21,7 @@ import { IThemeService } from 'vs/platform/theme/common/themeService';
template: ''
})
export class SelectBox extends AngularDisposable implements OnInit, OnChanges {
private _selectbox!: vsSelectBox;
private _selectbox!: sqlSelectBox;
@Input() options!: string[];
@Input() selectedOption!: string;
@@ -41,7 +41,7 @@ export class SelectBox extends AngularDisposable implements OnInit, OnChanges {
}
ngOnInit(): void {
this._selectbox = new vsSelectBox(this.options, this.selectedOption, this.contextViewService, undefined, { ariaLabel: this.ariaLabel });
this._selectbox = new sqlSelectBox(this.options, this.selectedOption, this.contextViewService, undefined, { ariaLabel: this.ariaLabel });
this._selectbox.render(this._el.nativeElement);
this._selectbox.onDidSelect(e => {
if (this.onlyEmitOnChange) {