You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Floating label on ion-datetime always floats if it's in a formGroup or has ngModel #11547
I'm submitting a ... (check one with "x")
[x] bug report
Current behavior:
A floating label on <ion-datetime> always floats above the input, even if no date is selected. This happens if the ion-datetime has ngModel or is in a formGroup. If it's neither, then it only floats when a date is selected (but then it becomes useless, as you can't actually get the value).
Expected behavior:
The floating label should only float when a date is selected.
Related code: Other information:
I think the issue is in the hasValue() method in base-input.ts. It returns true if the datetime has the "empty" date (which is just {}). Either ion-datetime should have null or undefined value until a date is selected, or it could override hasValue() and return false if the value is {}.
Ionic info:
> ionic info
Your system information:
ordova CLI: 7.0.0
Ionic Framework Version: 3.1.1
Ionic CLI Version: 2.2.3
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 1.3.6
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v6.10.3
Xcode version: Not installed```
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Activity
gandrade74 commentedon May 8, 2017
Same problem here.
fix(datetime): Fix floating label with empty ion-datetime (#11552)
ionitron-bot commentedon Sep 3, 2018
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.