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

gt - Add onBlur prop to DateInput #258

Merged
merged 3 commits into from
Jul 7, 2017
Merged

Conversation

gthomas-appfolio
Copy link
Contributor

No description provided.

const date = parse(value, this.props.dateFormat);

if (date) {
this.props.onBlur(date, true);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is weird. Why would we pass any of the value to onBlur ? This feels like API creep to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to allow simulating the previously-used react-widgets date picker which clears on blur if invalid. With this, it allows an (optional) hook to allow that can easily duplicate , but without adding that fairly specific "clearOnInvalid" behavior.

@gthomas-appfolio gthomas-appfolio merged commit 5727a63 into master Jul 7, 2017
@gthomas-appfolio gthomas-appfolio deleted the addDateInputOnBlur branch July 7, 2017 21:33
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