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 the built-in validation logic #1675

Closed
oliviertassinari opened this issue Apr 17, 2020 · 0 comments · Fixed by #1730
Closed

Remove the built-in validation logic #1675

oliviertassinari opened this issue Apr 17, 2020 · 0 comments · Fixed by #1730

Comments

@oliviertassinari
Copy link
Member

As raised by @dmtrKovalenko we will be better off leaving the resolution of this problem to the form libraries. We can simplify the component and save bundle size by moving in this direction. The only aspect we need to be cautious about is maintaining a way for the developers to know that the component has failed to format the input of the user.

We haven't looked too much into the resolution of this issue. We would need to benchmark first. Some options that came to mind:

  1. Add a new onError callback prop. But does it play well with the form libraries
  2. Add onInputChange callback prop to be able to double monitor the value of the textbox and the picker, exactly like the Autocomplete do. http://react-day-picker.js.org/examples/input-state
  3. Implement something similar to the native date picker input. If the value is invalid, it has: event.target.value === '' and event.target.validity.valid = false.

No matter what we pick, I think that we should decide based on formik, final-form, react-simple-form perspective.

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

Successfully merging a pull request may close this issue.

1 participant