Fixed issue: input change on dropdownbox not reflected to 'dropdownbox.… (#4316)

This commit is contained in:
Gene Lee
2019-03-07 13:35:10 -08:00
committed by GitHub
parent 9e1f04e476
commit 029c69ecd3
2 changed files with 6 additions and 0 deletions

View File

@@ -96,6 +96,7 @@ export class Dropdown extends Disposable {
private _filter = new DropdownFilter(); private _filter = new DropdownFilter();
private _renderer = new DropdownRenderer(); private _renderer = new DropdownRenderer();
private _controller = new DropdownController(); private _controller = new DropdownController();
public fireOnTextChange: boolean;
private _onBlur = this._register(new Emitter<void>()); private _onBlur = this._register(new Emitter<void>());
public onBlur: Event<void> = this._onBlur.event; public onBlur: Event<void> = this._onBlur.event;
@@ -211,6 +212,10 @@ export class Dropdown extends Disposable {
this._filter.filterString = e; this._filter.filterString = e;
this._layoutTree(); this._layoutTree();
} }
if (this.fireOnTextChange) {
this.value = e;
this._onValueChange.fire(e);
}
}); });
this._register(this._contextView); this._register(this._contextView);

View File

@@ -112,6 +112,7 @@ export default class DropDownComponent extends ComponentBase implements ICompone
this._editableDropdown.value = this.getSelectedValue(); this._editableDropdown.value = this.getSelectedValue();
} }
this._editableDropdown.enabled = this.enabled; this._editableDropdown.enabled = this.enabled;
this._editableDropdown.fireOnTextChange = properties['fireOnTextChange'];
} else { } else {
this._selectBox.setOptions(this.getValues()); this._selectBox.setOptions(this.getValues());
this._selectBox.selectWithOptionName(this.getSelectedValue()); this._selectBox.selectWithOptionName(this.getSelectedValue());