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
bug: ion-datetime hasValue returning true, regardless of control value #18540
Current behavior:
The hasValue() method on ion-datetime always returns true, due to the way the underlying value is stored - the check determines if Object.keys(...) has a length, which is always true in the case for ion-datetime since the underlying value is always an object.
This results in various behaviour occurring as if the ion-datetime has a value, even if it doesn't. For example, item-has-value is added to the wrapping ion-item which affects floating labels, and additional styling around this class.
Expected behavior:
For hasValue() to return true if the ion-datetime has a value, or false if not.
Steps to reproduce:
Add an ion-datetime wrapped inside an ion-item to a page.
Load the page.
Observe how the ion-item has the class item-has-value prior to being set to anything.
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
fix(datetime): datetime no longer reports having a value if none is s…
ionitron-bot commentedon Jul 27, 2019
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.