{"action":"created","issue":{"url":"https://api.github.com/repos/littlebits/react-popover/issues/41","labels_url":"https://api.github.com/repos/littlebits/react-popover/issues/41/labels{/name}","comments_url":"https://api.github.com/repos/littlebits/react-popover/issues/41/comments","events_url":"https://api.github.com/repos/littlebits/react-popover/issues/41/events","html_url":"https://github.com/littlebits/react-popover/issues/41","id":109156570,"number":41,"title":"Component keeps listening to events after unmount in certain situations","user":{"login":"clayne11","id":2831444,"avatar_url":"https://avatars.githubusercontent.com/u/2831444?v=3","gravatar_id":"","url":"https://api.github.com/users/clayne11","html_url":"https://github.com/clayne11","followers_url":"https://api.github.com/users/clayne11/followers","following_url":"https://api.github.com/users/clayne11/following{/other_user}","gists_url":"https://api.github.com/users/clayne11/gists{/gist_id}","starred_url":"https://api.github.com/users/clayne11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clayne11/subscriptions","organizations_url":"https://api.github.com/users/clayne11/orgs","repos_url":"https://api.github.com/users/clayne11/repos","events_url":"https://api.github.com/users/clayne11/events{/privacy}","received_events_url":"https://api.github.com/users/clayne11/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/littlebits/react-popover/labels/type%20/%20bug","name":"type / bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-09-30T18:56:18Z","updated_at":"2015-11-14T01:26:26Z","closed_at":null,"body":"I have found a use case where the Popover component is unmounted without calling exit(), which means the scroll / timer / onOuterAction listeners are all still hooked up. This is causes issues with the next Popover that I use because there are now two actions hooked up to onOuterAction, which means that no matter where I click, even on the Popover, it thinks it's an outer action and closes the Popover.\r\n\r\nI propose that exit() be called in componentWillUnmount() {} to be sure that the component gets cleaned up properly.\r\n\r\nCurrent componentWillUmount():\r\n\r\n```javascript\r\n  componentWillUnmount: function componentWillUnmount() {\r\n    clearInterval(this.checkLayoutInterval);\r\n  }\r\n```\r\n\r\nSuggested componentWillUmount():\r\n\r\n```javascript\r\n  componentWillUnmount: function componentWillUnmount() {\r\n    this.exit();\r\n  }\r\n```"},"comment":{"url":"https://api.github.com/repos/littlebits/react-popover/issues/comments/156604433","html_url":"https://github.com/littlebits/react-popover/issues/41#issuecomment-156604433","issue_url":"https://api.github.com/repos/littlebits/react-popover/issues/41","id":156604433,"user":{"login":"oliversong","id":546651,"avatar_url":"https://avatars.githubusercontent.com/u/546651?v=3","gravatar_id":"","url":"https://api.github.com/users/oliversong","html_url":"https://github.com/oliversong","followers_url":"https://api.github.com/users/oliversong/followers","following_url":"https://api.github.com/users/oliversong/following{/other_user}","gists_url":"https://api.github.com/users/oliversong/gists{/gist_id}","starred_url":"https://api.github.com/users/oliversong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oliversong/subscriptions","organizations_url":"https://api.github.com/users/oliversong/orgs","repos_url":"https://api.github.com/users/oliversong/repos","events_url":"https://api.github.com/users/oliversong/events{/privacy}","received_events_url":"https://api.github.com/users/oliversong/received_events","type":"User","site_admin":false},"created_at":"2015-11-14T01:26:26Z","updated_at":"2015-11-14T01:26:26Z","body":"+1- seeing this as well"}}