{"action":"created","issue":{"url":"https://api.github.com/repos/reactjs/react-modal/issues/134","repository_url":"https://api.github.com/repos/reactjs/react-modal","labels_url":"https://api.github.com/repos/reactjs/react-modal/issues/134/labels{/name}","comments_url":"https://api.github.com/repos/reactjs/react-modal/issues/134/comments","events_url":"https://api.github.com/repos/reactjs/react-modal/issues/134/events","html_url":"https://github.com/reactjs/react-modal/pull/134","id":139625411,"number":134,"title":"[fixed] Clear the delayed close timer when modal opens again","user":{"login":"CompuIves","id":587016,"avatar_url":"https://avatars.githubusercontent.com/u/587016?v=3","gravatar_id":"","url":"https://api.github.com/users/CompuIves","html_url":"https://github.com/CompuIves","followers_url":"https://api.github.com/users/CompuIves/followers","following_url":"https://api.github.com/users/CompuIves/following{/other_user}","gists_url":"https://api.github.com/users/CompuIves/gists{/gist_id}","starred_url":"https://api.github.com/users/CompuIves/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CompuIves/subscriptions","organizations_url":"https://api.github.com/users/CompuIves/orgs","repos_url":"https://api.github.com/users/CompuIves/repos","events_url":"https://api.github.com/users/CompuIves/events{/privacy}","received_events_url":"https://api.github.com/users/CompuIves/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-03-09T16:24:12Z","updated_at":"2016-05-17T20:16:49Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/reactjs/react-modal/pulls/134","html_url":"https://github.com/reactjs/react-modal/pull/134","diff_url":"https://github.com/reactjs/react-modal/pull/134.diff","patch_url":"https://github.com/reactjs/react-modal/pull/134.patch"},"body":"Currently there is an inconsistency when there is a delayed close and right after the start of this close the modal opens again.\r\nGraphic:\r\n```\r\n| closeWithTimeout\r\n|   setState - beforeClose: true\r\n| open\r\n|   setState - isOpen: true\r\n|   setState - afterOpen: true\r\n| closeWithoutTimeout\r\n|   setState - beforeClose: false\r\n|   setState - afterOpen: false\r\nv\r\n```\r\nNow we have this state:\r\n```javascript\r\n{\r\n  beforeClose: false,\r\n  isOpen: true,\r\n  afterOpen: false,\r\n}\r\n```\r\n\r\nWhich gives an invisible modal.\r\n\r\nThis PR should fix it by just skipping the open logic (since the modal is already open) and clearing the timeout and returning beforeClose to false."},"comment":{"url":"https://api.github.com/repos/reactjs/react-modal/issues/comments/219840027","html_url":"https://github.com/reactjs/react-modal/pull/134#issuecomment-219840027","issue_url":"https://api.github.com/repos/reactjs/react-modal/issues/134","id":219840027,"user":{"login":"diasbruno","id":362368,"avatar_url":"https://avatars.githubusercontent.com/u/362368?v=3","gravatar_id":"","url":"https://api.github.com/users/diasbruno","html_url":"https://github.com/diasbruno","followers_url":"https://api.github.com/users/diasbruno/followers","following_url":"https://api.github.com/users/diasbruno/following{/other_user}","gists_url":"https://api.github.com/users/diasbruno/gists{/gist_id}","starred_url":"https://api.github.com/users/diasbruno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diasbruno/subscriptions","organizations_url":"https://api.github.com/users/diasbruno/orgs","repos_url":"https://api.github.com/users/diasbruno/repos","events_url":"https://api.github.com/users/diasbruno/events{/privacy}","received_events_url":"https://api.github.com/users/diasbruno/received_events","type":"User","site_admin":false},"created_at":"2016-05-17T20:16:49Z","updated_at":"2016-05-17T20:16:49Z","body":"yep, almost forgot...i'll finish this today!"}}