From 92e0f9863359bbc7b4e86c12e1299b423ded1882 Mon Sep 17 00:00:00 2001 From: Kelvin Dart Date: Thu, 27 Jun 2019 15:48:09 +0100 Subject: [PATCH] fix(datetime): datetime no longer reports having a value if none is set (#18541) fixes #17979 fixes #18540 --- core/src/components/datetime/datetime.tsx | 3 +-- core/src/components/datetime/test/basic/index.html | 10 ++++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/core/src/components/datetime/datetime.tsx b/core/src/components/datetime/datetime.tsx index 389d7a88bc..1cf77789f7 100644 --- a/core/src/components/datetime/datetime.tsx +++ b/core/src/components/datetime/datetime.tsx @@ -565,8 +565,7 @@ export class Datetime implements ComponentInterface { } private hasValue(): boolean { - const val = this.datetimeValue; - return Object.keys(val).length > 0; + return this.text !== undefined; } private setFocus() { diff --git a/core/src/components/datetime/test/basic/index.html b/core/src/components/datetime/test/basic/index.html index 01b9f4b069..3cf5be322a 100644 --- a/core/src/components/datetime/test/basic/index.html +++ b/core/src/components/datetime/test/basic/index.html @@ -31,6 +31,16 @@ Default + + + Default with floating label + + + + + Placeholder with floating label + + Max