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

Allow the user to clear input and trigger an event with the change. #225

Merged

Conversation

leio10
Copy link
Contributor

@leio10 leio10 commented Jan 18, 2018

This is the current behavior when clearing the input content:

  • When initialDate is set, DatePicker will use it as value when you clear the contents of the input. So, if you are editing an optional date field with a persisted value, it won't let you to unset it, because initialDate has a value.
  • When initialDate is not set, DatePicker will allow you yo clear the input content, but it will not raise a changeDate with a no-date value. So, when you are creating a new record with an optional date field, if you select a date and then delete it, it will allow you to do it, but all code depending on the changeDate won't notice the last value change.

What I propose:

  • Set initialDate only on initialization code.
  • Trigger changeDate event with a null date when the input is cleared.
  • Rest of the changes are formatting changes done by my text editor, I can remove them if preferred.

@leio10 leio10 changed the title Allow the user to clear input and trigger and event with the change. Allow the user to clear input and trigger an event with the change. Jan 18, 2018
@najlepsiwebdesigner
Copy link
Owner

najlepsiwebdesigner commented Jan 19, 2018 via email

@najlepsiwebdesigner najlepsiwebdesigner merged commit 49cb342 into najlepsiwebdesigner:master Jan 20, 2018
@leio10 leio10 deleted the fix/allow-clear-value branch January 22, 2018 08:59
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