mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
Merge branch 'master' into 3.0
# Conflicts: # src/components/action-sheet/test/basic/pages/page-one/page-one.ts # src/components/alert/alert.ts # src/components/content/content.ts # src/components/datetime/datetime.ts # src/components/datetime/test/datetime.spec.ts # src/components/loading/loading.ts # src/components/modal/test/basic/app.module.ts # src/components/picker/picker-component.ts # src/components/toast/toast.ts # src/components/toolbar/toolbar.ios.scss # src/components/toolbar/toolbar.md.scss # src/components/toolbar/toolbar.wp.scss # src/components/virtual-scroll/test/basic/app.module.ts # src/util/util.ts
This commit is contained in:
@ -390,6 +390,21 @@ export class Select extends Ion implements AfterContentInit, ControlValueAccesso
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
checkHasValue(inputValue: any) {
|
||||
if (this._item) {
|
||||
let hasValue: boolean;
|
||||
if (Array.isArray(inputValue)) {
|
||||
hasValue = inputValue.length > 0;
|
||||
} else {
|
||||
hasValue = !isBlank(inputValue);
|
||||
}
|
||||
this._item.setElementClass('input-has-value', hasValue);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
@ContentChildren(Option)
|
||||
set options(val: QueryList<Option>) {
|
||||
this._options = val;
|
||||
@ -445,6 +460,7 @@ export class Select extends Ion implements AfterContentInit, ControlValueAccesso
|
||||
console.debug('select, writeValue', val);
|
||||
this._values = (Array.isArray(val) ? val : isBlank(val) ? [] : [val]);
|
||||
this._updOpts();
|
||||
this.checkHasValue(val);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -464,6 +480,7 @@ export class Select extends Ion implements AfterContentInit, ControlValueAccesso
|
||||
fn(val);
|
||||
this._values = (Array.isArray(val) ? val : isBlank(val) ? [] : [val]);
|
||||
this._updOpts();
|
||||
this.checkHasValue(val);
|
||||
this.onTouched();
|
||||
};
|
||||
}
|
||||
@ -481,6 +498,7 @@ export class Select extends Ion implements AfterContentInit, ControlValueAccesso
|
||||
console.debug('select, onChange w/out formControlName', val);
|
||||
this._values = (Array.isArray(val) ? val : isBlank(val) ? [] : [val]);
|
||||
this._updOpts();
|
||||
this.checkHasValue(val);
|
||||
this.onTouched();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user