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

fix EuiToolTip from setting state on unmounted component #1163

Merged
merged 3 commits into from
Sep 5, 2018

Conversation

nreese
Copy link
Contributor

@nreese nreese commented Sep 5, 2018

Fixes Kibana issue elastic/kibana#22543

Putting an EuiToolTip in a popover, opening the popover, and then using esc to close the popover causes hideToolTip to set state on an unmounted component.

componentDidUpdate(prevProps, prevState) {
if (prevState.visible === false && this.state.visible === true) {
requestAnimationFrame(this.testAnchor);
}
}

testAnchor = () => {
if (!this._isMounted) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this check should go into this component's hideToolTip method, which does the actual state setting.

Copy link
Contributor

@chandlerprall chandlerprall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code changes LGTM

@nreese nreese merged commit 95de5a7 into elastic:master Sep 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants