提交 1b176c1b 编写于 作者: I isidor

select box fix

上级 df532cda
......@@ -26,8 +26,7 @@ export class SelectBox extends Widget {
this.selectElement = document.createElement('select');
this.selectElement.className = 'select-box';
this.options = options;
this.selected = selected;
this.setOptions(options, selected);
this.toDispose = [];
this._onDidSelect = new Emitter<string>();
......@@ -42,7 +41,7 @@ export class SelectBox extends Widget {
}
public setOptions(options: string[], selected?: number): void {
if (!arrays.equals(this.options, options)) {
if (!this.options || !arrays.equals(this.options, options)) {
this.options = options;
this.selectElement.options.length = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册