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

Mark date inputs as valid when (partially) cleared #1154

Conversation

pauln
Copy link
Contributor

@pauln pauln commented Jun 5, 2020

Chrome 83 has removed the clear button from date inputs, which means that there's now no way to clear a date field and have its validity state correctly updated. Since the oninput event fired when the first date component is cleared provides an empty string as the new value, we can detect this and override validity.badInput to immediately update our validity state in order to avoid leaving the field permanently flagged as invalid.

Fixes #1153

Chrome 83 has removed the clear button from date inputs, which means that there's now no way to clear a date field and have its validity state correctly updated.  Since the `oninput` event fired when the first date component is cleared provides an empty string as the new value, we can detect this and override `validity.badInput` to immediately update our validity state in order to avoid leaving the field permanently flagged as invalid.

Fixes adopted-ember-addons#1153
@miguelcobain miguelcobain merged commit 8389416 into adopted-ember-addons:master Jun 12, 2020
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.

Clearing a date field leaves it marked invalid in Chrome 83
2 participants