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

parentSelector does not cause DOM update #468

Open
rplotkin opened this issue Aug 3, 2017 · 1 comment
Open

parentSelector does not cause DOM update #468

rplotkin opened this issue Aug 3, 2017 · 1 comment
Labels

Comments

@rplotkin
Copy link

rplotkin commented Aug 3, 2017

Really, the issue is that the parentSelector will not cause a DOM update if the modal is not open when the parentSelector is changed. In componentWillReceiveProps,

if (!this.props.isOpen && !isOpen) return;
var currentParent = getParentElement(this.props.parentSelector);
var newParent = getParentElement(newProps.parentSelector);

which means that, if the component is closed, newParent becomes currentParent in this cycle, and then the equality check is always true, even though the component did not get moved.

@diasbruno diasbruno added the bug label Aug 3, 2017
@diasbruno
Copy link
Collaborator

@rplotkin can you make a small example of for issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants