Skip to content

Conversation

@xxx
Copy link

@xxx xxx commented Jan 30, 2020

There is a PR up at jasonkuhrt/react-popover#208, but it doesn't actually work AFAICT (tested in their own storybook locally). The problem is that the check for state change isn't enough, as it creates a chicken and egg problem with when the containerEl field is set on the popover ref - the state doesn't change initially.

The state can't be assumed to change always, so go back to checking props for opening/closing, the way the component worked previously (except do it in componentDidUpdate to prevent the warning spew)

@@ -0,0 +1,268 @@
"use strict";
Copy link
Author

Choose a reason for hiding this comment

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

The build dir is included so we can use this directly from github

}
componentDidUpdate(propsPrev, statePrev) {
//log(`Component did update!`)
const willOpen = !propsPrev.isOpen && this.props.isOpen
Copy link
Author

Choose a reason for hiding this comment

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

this is the only actual change. See 457401b for the original change that doesn't go far enough.

@xxx xxx merged commit 2b4a23a into master Jan 30, 2020
@xxx xxx deleted the mpd/state-fixup branch January 30, 2020 22:07
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.

3 participants