fix(datetime): datetime no longer reports having a value if none is set (#18541)

fixes #17979 
fixes #18540
This commit is contained in:
Kelvin Dart
2019-06-27 15:48:09 +01:00
committed by Liam DeBeasi
parent 22ac160021
commit 45b82dc466
2 changed files with 11 additions and 2 deletions

View File

@ -565,8 +565,7 @@ export class Datetime implements ComponentInterface {
} }
private hasValue(): boolean { private hasValue(): boolean {
const val = this.datetimeValue; return this.text !== undefined;
return Object.keys(val).length > 0;
} }
private setFocus() { private setFocus() {

View File

@ -31,6 +31,16 @@
<ion-label>Default</ion-label> <ion-label>Default</ion-label>
<ion-datetime></ion-datetime> <ion-datetime></ion-datetime>
</ion-item> </ion-item>
<ion-item>
<ion-label position="floating">Default with floating label</ion-label>
<ion-datetime></ion-datetime>
</ion-item>
<ion-item>
<ion-label position="floating">Placeholder with floating label</ion-label>
<ion-datetime placeholder="Select a date"></ion-datetime>
</ion-item>
<ion-item> <ion-item>
<ion-label>Max</ion-label> <ion-label>Max</ion-label>