fix dropdown component issue (#1709)

* fix dropdown component issue

* handle enable property default
This commit is contained in:
Alan Ren
2018-06-21 18:00:07 -07:00
committed by GitHub
parent 6c5fac997f
commit 322847469d
3 changed files with 10 additions and 13 deletions

View File

@@ -380,7 +380,8 @@ class ComponentWrapper implements sqlops.Component {
}
public get enabled(): boolean {
return this.properties['enabled'];
let isEnabled = this.properties['enabled'];
return (isEnabled === undefined) ? true : isEnabled;
}
public set enabled(value: boolean) {
@@ -782,7 +783,11 @@ class DropDownWrapper extends ComponentWrapper implements sqlops.DropDownCompone
}
public get value(): string | sqlops.CategoryValue {
return this.properties['value'];
let val = this.properties['value'];
if (!val && this.values && this.values.length > 0) {
val = this.values[0];
}
return val;
}
public set value(v: string | sqlops.CategoryValue) {
this.setProperty('value', v);