fix(DatePicker): updated onBlur logic for empty date#9373
Merged
tlabaj merged 3 commits intopatternfly:mainfrom Aug 8, 2023
Merged
fix(DatePicker): updated onBlur logic for empty date#9373tlabaj merged 3 commits intopatternfly:mainfrom
tlabaj merged 3 commits intopatternfly:mainfrom
Conversation
92263f2 to
ad46e4d
Compare
Collaborator
|
Preview: https://patternfly-react-pr-9373.surge.sh A11y report: https://patternfly-react-pr-9373-a11y.surge.sh |
edonehoo
reviewed
Jul 19, 2023
packages/react-core/src/components/DatePicker/examples/DatePicker.md
Outdated
Show resolved
Hide resolved
ad46e4d to
6d659bb
Compare
kmcfaul
approved these changes
Jul 26, 2023
adamviktora
added a commit
to adamviktora/patternfly-react
that referenced
this pull request
Jul 31, 2023
6d659bb to
96bce1d
Compare
nicolethoen
approved these changes
Aug 3, 2023
tlabaj
requested changes
Aug 7, 2023
96bce1d to
c62c19c
Compare
adamviktora
added a commit
to adamviktora/patternfly-react
that referenced
this pull request
Aug 18, 2023
thatblindgeye
pushed a commit
that referenced
this pull request
Aug 24, 2023
* fix(DatePicker): clear error on date reset * feat(DatePicker): add clear date example to controlled DatePicker * test(DatePicker): add integration test for clear date * feat(DatePicker): update clear date logic based on #9373 * fix(DatePicker): hide error when date cleared and not required + show error when cleared and required * refactor(DatePicker) * fix(DatePicker): prop removal
nicolethoen
pushed a commit
to Kells512/patternfly-react
that referenced
this pull request
Sep 1, 2023
* fix(DatePicker): updated onBlur logic for empty date * Updated example description * Grouped isRequired and emptyDateText props as one
nicolethoen
pushed a commit
to Kells512/patternfly-react
that referenced
this pull request
Sep 1, 2023
…y#9267) * fix(DatePicker): clear error on date reset * feat(DatePicker): add clear date example to controlled DatePicker * test(DatePicker): add integration test for clear date * feat(DatePicker): update clear date logic based on patternfly#9373 * fix(DatePicker): hide error when date cleared and not required + show error when cleared and required * refactor(DatePicker) * fix(DatePicker): prop removal
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What: Closes #8779
Originally had added logic to call
setErrorifpristine && isRequired, but that would have required a consumer to always pass in a validator tovalidatorsarray; something along the lines ofvalidators={[(date) => !date ? 'Date cannot be blank' : '']}.Just adding a new isRequired and emptyDateText props will make it easier for consumers, and it avoids a case of
isRequiredbeing passed in but an error message never appearing if a validator isn't passed in.This is somewhat dependent on #9267, but should just require a slight tweak in that PRs code (the
value === '' && setErrorText('')line)Additional issues: