-
Notifications
You must be signed in to change notification settings - Fork 841
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
[EuiSuperDatePicker] date popover onChange should only accept strings #3460
Conversation
Preview documentation changes for this PR: https://eui.elastic.co/pr_3460/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_3460/ |
src/components/date_picker/super_date_picker/date_popover/absolute_tab.tsx
Outdated
Show resolved
Hide resolved
Preview documentation changes for this PR: https://eui.elastic.co/pr_3460/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_3460/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes LGTM. Tested manual entry in the Absolute tab and it's not broken anymore 🎉
Preview documentation changes for this PR: https://eui.elastic.co/pr_3460/ |
Summary
Manual datetime entry via the input in the 'Absolute' tab would result in a Moment object being passed up through the component and causing errors. The the
onChange
event parameter for date_popover_content was mistyped as allowing Moment objects when in all cases the value is treated as astring
.This restricts the interface to the expected
string
type and uses an ISO string in place of the full Moment object.Checklist
- [ ] Check against all themes for compatibility in both light and dark modes- [ ] Checked in mobile- [ ] Checked in IE11 and Firefox- [ ] Props have proper autodocs- [ ] Added documentation examples- [ ] Added or updated jest tests- [ ] Checked for accessibility including keyboard-only and screenreader modes