[EuiDatePicker] Handle invalid selected moment formats#7784
Merged
cee-chen merged 6 commits intoelastic:mainfrom May 23, 2024
Merged
[EuiDatePicker] Handle invalid selected moment formats#7784cee-chen merged 6 commits intoelastic:mainfrom
selected moment formats#7784cee-chen merged 6 commits intoelastic:mainfrom
Conversation
+ show the invalid icon/indicator automatically if the moment date is invalid
…lid selected date
mgadewoll
approved these changes
May 23, 2024
Contributor
mgadewoll
left a comment
There was a problem hiding this comment.
🚢 🐈⬛ Nice fix! And the updated code works as expected 👍
tkajtoch
reviewed
May 23, 2024
This reverts commit e357261.
|
Preview staging links for this PR:
|
Collaborator
💚 Build Succeeded
History
cc @cee-chen |
tkajtoch
added a commit
to elastic/kibana
that referenced
this pull request
May 29, 2024
`v94.5.1` ⏩ `v94.5.2` _[Questions? Please see our Kibana upgrade FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)_ --- ## [`v94.5.2`](https://github.com/elastic/eui/releases/v94.5.2) **Bug fixes** - Fixed `EuiDatePicker` to more gracefully handle incorrectly formatted `selected` Moment dates, instead of simply crashing ([#7784](elastic/eui#7784)) - Fixed `EuiFlexGroup` and `EuiFlexItem` types to correctly accept global attribute props and simplify type resolution when used with `styled()`-like wrappers ([#7792](elastic/eui#7792))
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.
Summary
@shahzad31 reported this issue to us in Slack - passing an invalid
moment()date to theselectedprop causes a maximum update depth exceeded React error. We should be more gracefully handling and alerting consumers to this issue without just blanket crashing JS.QA
Invalid datevalue (with danger icon/coloring)General checklist
- [ ] Checked in both light and dark modes- [ ] Checked in mobileand cypress tests- [ ] If applicable, added the breaking change issue label (and filled out the breaking change checklist)