Skip to content
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 move EuiDatePopoverButton isOpen state into EuiSuperDatePicker #1494

Merged
merged 2 commits into from
Jan 29, 2019

Conversation

nreese
Copy link
Contributor

@nreese nreese commented Jan 29, 2019

There is a bug were updating props resets EuiSuperDatePicker showPrettyDuration. The bug occurs when either start or end EuiSuperDatePicker is open. Clicking on the tabs changes the respective time and calls onChange causing EuiSuperDatePicker.getDerivedStateFromProps to potentially set showPrettyDuration to true. This causes the EuiDatePopoverButton to close unexpectedly because the component is unmounted. The bug is that displaying the pretty duration check only looks at showPrettyDuration and does not take into account if the date popovers are open.

This PR moves the tracking of EuiDatePopoverButton isOpen state into EuiSuperDatePicker so that the pretty duration is only displayed when showPrettyDuration is true and the date popovers are not open.

@nreese nreese merged commit 2d3bbd6 into elastic:master Jan 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants