Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(datetime): onChange without formControlName sets input-has-value … #8947

Merged

Conversation

hotforfeature
Copy link
Contributor

Short description of what this resolves:

When using an <ion-datetime> component outside of a form, checkHasValue() is not called during onChange(), which results in the .input-has-value missing from the <ion-item>

Changes proposed in this pull request:

Changes the default onChange() function to match registerOnChange() and invoke this.checkHasValue(val); after setting the value and updating the text.

Ionic Version: 2.0.0-rc.1

@brandyscarney brandyscarney self-assigned this Nov 10, 2016
@hotforfeature
Copy link
Contributor Author

@brandyscarney it's been 2 months since this was opened, any update on if this needs changing or discussion to be merged?

@brandyscarney
Copy link
Member

@hotforfeature Is there an issue open that discusses this? Or could you provide an e2e test or plunker that demonstrates the issue please? :)

@hotforfeature
Copy link
Contributor Author

No open issue yet, here's a plunker:
http://plnkr.co/edit/Vf3V3uUYQurd07ZDigAk?p=preview

This issue affects floating labels only, since the label uses the .input-has-value to indicate whether or not it should float. The plunker shows three datetime items. When an <ion-datetime> is outside or inside a form without a form control to call checkHasValue(), the label does not float when a date is selected.

The <ion-datetime> that is inside a form and has a form control has its label float properly.

@hotforfeature
Copy link
Contributor Author

This is still an issue in 2.0.0-rc.4, I haven't upgraded to 5 to test yet. Any updates @brandyscarney?

@hotforfeature
Copy link
Contributor Author

@brandyscarney this bug is still present in the 2.0.0 release. I've updated the plunker to demonstrate: http://plnkr.co/edit/dADXF8OTABXI4Beq1QBr?p=preview

@brandyscarney brandyscarney added this to the 2.0.1 milestone Jan 30, 2017
@brandyscarney brandyscarney merged commit 81c3394 into ionic-team:master Jan 30, 2017
@brandyscarney
Copy link
Member

@hotforfeature Thanks! Sorry it took so long to get this in and thank you for the plunkers. I released a nightly with it:

npm install --save --save-exact [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants