-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(dateinput): clear validation errors when a datepicker selects a date
YJDH-684. Since the HDS DateInput has a compatibility issue with React-hook-forms, The onChange should include processes to 1) clear the input validation errors and 2) set the input value. Otherwise the errors are not cleared when a datepicker is used. The onChange is currently not in the same format as the HDS dateinput is expecting it to be. HDS DateInputProps are waiting for (value: string, valueAsDate: Date), but onChange from the InputProps is (value: string). OnChange of the React-hook-Forms waits a SyntheticEvent as a parameter. NOTE: The HDS v. 3.0.0 will change the DateInput onChange to have an Event as a parameter.
- Loading branch information
1 parent
c3fa7ea
commit 0f27519
Showing
2 changed files
with
48 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters