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

remove partially filled validation error on clear #283

Conversation

jelhan
Copy link
Owner

@jelhan jelhan commented Nov 2, 2019

Change event is not triggered on clear if field was only partially filled. Therefor validation error may not be cleared if only relying on change event. It should at least also be removed if element loose focus.

It would be even better if validation error is updated directly after user clears the input. But that's not an easy one as neither change nor input element are triggered reliable. But as far as I've tested it should work by listening to this events:

  • keyup evnet is fired if input is cleared with keyboard (e.g. backspace).
  • focusin event is fired if input is cleared using button provided by native UI. (input event is only fired if element does not have focus before.)

Please note that only Chrome is affected as that's the only browser showing that validation error.

Closes #281

@jelhan jelhan changed the title remove partially filled validation error on clear WIP: remove partially filled validation error on clear Nov 3, 2019
@jelhan jelhan changed the title WIP: remove partially filled validation error on clear remove partially filled validation error on clear Nov 3, 2019
@jelhan jelhan merged commit bde9254 into master Nov 3, 2019
@jelhan jelhan deleted the issue-281-partially-filled-validation-error-must-be-removed-on-clear branch October 13, 2020 15:48
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.

Partially filled time validation error is not cleared if input is cleared
1 participant