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

Move event listeners so they are added/removed only when portal is active (fix #175) #206

Closed
wants to merge 2 commits into from

Conversation

thoomasbro
Copy link

see #175

@@ -26,6 +26,7 @@
"clean": "rimraf es lib build",
"prepublish": "cross-env NODE_ENV=production npm run build",
"lint": "eslint webpack.config.js src/**/*.js",
"prepare": "cross-env NODE_ENV=production npm run build",
Copy link
Owner

Choose a reason for hiding this comment

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

why?

this.setState({ active: true }, this.props.onOpen);
if (this.props.closeOnOutsideClick) {
Copy link
Owner

Choose a reason for hiding this comment

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

Can you write a test for this?

@@ -40,17 +37,20 @@ class PortalWithState extends React.Component {
if (this.state.active) {
return;
}
if (e && e.nativeEvent) {
Copy link
Owner

Choose a reason for hiding this comment

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

Can this really be removed?

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.

None yet

2 participants