Pass invalid values to the onDateChange prop
See original GitHub issueI believe it would be helpful to a lot of developers to be able to know if an invalid date has been typed by the user into the <input type="text">
node. In my opinion, the most logical place to provide that information would be in the onDateChange
handler. I could see an argument for a simple boolean
that’s false
if the input is not a valid moment.Moment
or passing the invalid input as a string
.
I know that an invalid input just passes null
as the date to the handler, but that being the case, there’s no way to differentiate between the user simply clearing the data (a valid interaction) versus entering text that can’t be parsed into a valid date (an invalid interaction).
If you allow pull requests from the masses, I would be more than happy to make the change and submit a PR.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7 (3 by maintainers)
Top GitHub Comments
@ljharb thanks. Submitted. 👍
The workflow in general terms for making a PR to any open source project is to fork the repo, make a branch on the fork with your changes, and then make a PR to merge that to the source’s default branch (usually
master
).