mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
fix(datetime): datetime no longer reports having a value if none is set (#18541)
fixes #17979 fixes #18540
This commit is contained in:
committed by
Liam DeBeasi
parent
22ac160021
commit
45b82dc466
@ -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() {
|
||||||
|
|||||||
@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user