{"action":"opened","number":9408,"pull_request":{"url":"https://api.github.com/repos/ant-design/ant-design/pulls/9408","id":171171696,"html_url":"https://github.com/ant-design/ant-design/pull/9408","diff_url":"https://github.com/ant-design/ant-design/pull/9408.diff","patch_url":"https://github.com/ant-design/ant-design/pull/9408.patch","issue_url":"https://api.github.com/repos/ant-design/ant-design/issues/9408","number":9408,"state":"open","locked":false,"title":"do somthing after slide up animation of Alert component","user":{"login":"Hughen","id":3334378,"avatar_url":"https://avatars2.githubusercontent.com/u/3334378?v=4","gravatar_id":"","url":"https://api.github.com/users/Hughen","html_url":"https://github.com/Hughen","followers_url":"https://api.github.com/users/Hughen/followers","following_url":"https://api.github.com/users/Hughen/following{/other_user}","gists_url":"https://api.github.com/users/Hughen/gists{/gist_id}","starred_url":"https://api.github.com/users/Hughen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hughen/subscriptions","organizations_url":"https://api.github.com/users/Hughen/orgs","repos_url":"https://api.github.com/users/Hughen/repos","events_url":"https://api.github.com/users/Hughen/events{/privacy}","received_events_url":"https://api.github.com/users/Hughen/received_events","type":"User","site_admin":false},"body":"I difficultly use Alert.onClose to beautifully close it.\r\n\r\nproblem case:\r\n```javascript\r\nclass ProblemView extends React.Component {\r\n  constructor(props) {\r\n    super(props);\r\n\r\n    this.state = {\r\n      show: true\r\n    };\r\n  }\r\n\r\n  render() {\r\n    return (\r\n      <div>\r\n        <p>this view just indicate design defect in Alert.</p>\r\n        {\r\n          this.state.show ? (\r\n            <Alert\r\n              closable\r\n              message=\"Alert Message...\"\r\n              onClose={() => this.setState({show: false})}\r\n            />\r\n          ):null\r\n        }\r\n      </div>\r\n    )\r\n  }\r\n}\r\n```\r\nIn above code, the alert slide-up animation can not be working, because the parent state(ProblemView) distribute update action maybe faster than itself animation during the closing effect.\r\n\r\nSo, antd should move `onClose` to bottom of `animationEnd` or add `onAfterClosed` property to fixed it, just like this:\r\n```javascript\r\nhandleClose = (e) => {\r\n  e.preventDefault();\r\n  let dom = ReactDOM.findDOMNode(this) as HTMLElement;\r\n  dom.style.height = `${dom.offsetHeight}px`;\r\n  dom.style.height = `${dom.offsetHeight}px`;\r\n\r\n  this.setState({\r\n    closing: false,\r\n  });\r\n  // I cancel call function of onClose from `handleClose`\r\n};\r\nanimationEnd = () => {\r\n  this.setState({\r\n    closed: true,\r\n    closing: true,\r\n  });\r\n  (this.props.onAfterClosed || this.props.onClose || noop)();\r\n};\r\n```\r\n\r\nQ: why I can do it?\r\nA: The `onClose` feature is too little avail to slide up a alert message, most of the time I just want to smooth close the alert, because the alert has a slide-up animation during it's closing.","created_at":"2018-02-24T09:57:27Z","updated_at":"2018-02-24T09:57:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ant-design/ant-design/pulls/9408/commits","review_comments_url":"https://api.github.com/repos/ant-design/ant-design/pulls/9408/comments","review_comment_url":"https://api.github.com/repos/ant-design/ant-design/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ant-design/ant-design/issues/9408/comments","statuses_url":"https://api.github.com/repos/ant-design/ant-design/statuses/06ff0d44db70f8b5e89fc789a674d8a870aa9905","head":{"label":"ant-design:2.x-stable","ref":"2.x-stable","sha":"06ff0d44db70f8b5e89fc789a674d8a870aa9905","user":{"login":"ant-design","id":12101536,"avatar_url":"https://avatars3.githubusercontent.com/u/12101536?v=4","gravatar_id":"","url":"https://api.github.com/users/ant-design","html_url":"https://github.com/ant-design","followers_url":"https://api.github.com/users/ant-design/followers","following_url":"https://api.github.com/users/ant-design/following{/other_user}","gists_url":"https://api.github.com/users/ant-design/gists{/gist_id}","starred_url":"https://api.github.com/users/ant-design/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ant-design/subscriptions","organizations_url":"https://api.github.com/users/ant-design/orgs","repos_url":"https://api.github.com/users/ant-design/repos","events_url":"https://api.github.com/users/ant-design/events{/privacy}","received_events_url":"https://api.github.com/users/ant-design/received_events","type":"Organization","site_admin":false},"repo":{"id":34526884,"name":"ant-design","full_name":"ant-design/ant-design","owner":{"login":"ant-design","id":12101536,"avatar_url":"https://avatars3.githubusercontent.com/u/12101536?v=4","gravatar_id":"","url":"https://api.github.com/users/ant-design","html_url":"https://github.com/ant-design","followers_url":"https://api.github.com/users/ant-design/followers","following_url":"https://api.github.com/users/ant-design/following{/other_user}","gists_url":"https://api.github.com/users/ant-design/gists{/gist_id}","starred_url":"https://api.github.com/users/ant-design/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ant-design/subscriptions","organizations_url":"https://api.github.com/users/ant-design/orgs","repos_url":"https://api.github.com/users/ant-design/repos","events_url":"https://api.github.com/users/ant-design/events{/privacy}","received_events_url":"https://api.github.com/users/ant-design/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ant-design/ant-design","description":"🐜 A UI Design Language","fork":false,"url":"https://api.github.com/repos/ant-design/ant-design","forks_url":"https://api.github.com/repos/ant-design/ant-design/forks","keys_url":"https://api.github.com/repos/ant-design/ant-design/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ant-design/ant-design/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ant-design/ant-design/teams","hooks_url":"https://api.github.com/repos/ant-design/ant-design/hooks","issue_events_url":"https://api.github.com/repos/ant-design/ant-design/issues/events{/number}","events_url":"https://api.github.com/repos/ant-design/ant-design/events","assignees_url":"https://api.github.com/repos/ant-design/ant-design/assignees{/user}","branches_url":"https://api.github.com/repos/ant-design/ant-design/branches{/branch}","tags_url":"https://api.github.com/repos/ant-design/ant-design/tags","blobs_url":"https://api.github.com/repos/ant-design/ant-design/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ant-design/ant-design/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ant-design/ant-design/git/refs{/sha}","trees_url":"https://api.github.com/repos/ant-design/ant-design/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ant-design/ant-design/statuses/{sha}","languages_url":"https://api.github.com/repos/ant-design/ant-design/languages","stargazers_url":"https://api.github.com/repos/ant-design/ant-design/stargazers","contributors_url":"https://api.github.com/repos/ant-design/ant-design/contributors","subscribers_url":"https://api.github.com/repos/ant-design/ant-design/subscribers","subscription_url":"https://api.github.com/repos/ant-design/ant-design/subscription","commits_url":"https://api.github.com/repos/ant-design/ant-design/commits{/sha}","git_commits_url":"https://api.github.com/repos/ant-design/ant-design/git/commits{/sha}","comments_url":"https://api.github.com/repos/ant-design/ant-design/comments{/number}","issue_comment_url":"https://api.github.com/repos/ant-design/ant-design/issues/comments{/number}","contents_url":"https://api.github.com/repos/ant-design/ant-design/contents/{+path}","compare_url":"https://api.github.com/repos/ant-design/ant-design/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ant-design/ant-design/merges","archive_url":"https://api.github.com/repos/ant-design/ant-design/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ant-design/ant-design/downloads","issues_url":"https://api.github.com/repos/ant-design/ant-design/issues{/number}","pulls_url":"https://api.github.com/repos/ant-design/ant-design/pulls{/number}","milestones_url":"https://api.github.com/repos/ant-design/ant-design/milestones{/number}","notifications_url":"https://api.github.com/repos/ant-design/ant-design/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ant-design/ant-design/labels{/name}","releases_url":"https://api.github.com/repos/ant-design/ant-design/releases{/id}","deployments_url":"https://api.github.com/repos/ant-design/ant-design/deployments","created_at":"2015-04-24T15:37:24Z","updated_at":"2018-02-24T09:32:58Z","pushed_at":"2018-02-24T03:47:27Z","git_url":"git://github.com/ant-design/ant-design.git","ssh_url":"git@github.com:ant-design/ant-design.git","clone_url":"https://github.com/ant-design/ant-design.git","svn_url":"https://github.com/ant-design/ant-design","homepage":"http://ant.design","size":226898,"stargazers_count":24536,"watchers_count":24536,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":6985,"mirror_url":null,"archived":false,"open_issues_count":167,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":6985,"open_issues":167,"watchers":24536,"default_branch":"master"}},"base":{"label":"ant-design:master","ref":"master","sha":"c28d6f162480430ca196176fcfa99781a51e9039","user":{"login":"ant-design","id":12101536,"avatar_url":"https://avatars3.githubusercontent.com/u/12101536?v=4","gravatar_id":"","url":"https://api.github.com/users/ant-design","html_url":"https://github.com/ant-design","followers_url":"https://api.github.com/users/ant-design/followers","following_url":"https://api.github.com/users/ant-design/following{/other_user}","gists_url":"https://api.github.com/users/ant-design/gists{/gist_id}","starred_url":"https://api.github.com/users/ant-design/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ant-design/subscriptions","organizations_url":"https://api.github.com/users/ant-design/orgs","repos_url":"https://api.github.com/users/ant-design/repos","events_url":"https://api.github.com/users/ant-design/events{/privacy}","received_events_url":"https://api.github.com/users/ant-design/received_events","type":"Organization","site_admin":false},"repo":{"id":34526884,"name":"ant-design","full_name":"ant-design/ant-design","owner":{"login":"ant-design","id":12101536,"avatar_url":"https://avatars3.githubusercontent.com/u/12101536?v=4","gravatar_id":"","url":"https://api.github.com/users/ant-design","html_url":"https://github.com/ant-design","followers_url":"https://api.github.com/users/ant-design/followers","following_url":"https://api.github.com/users/ant-design/following{/other_user}","gists_url":"https://api.github.com/users/ant-design/gists{/gist_id}","starred_url":"https://api.github.com/users/ant-design/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ant-design/subscriptions","organizations_url":"https://api.github.com/users/ant-design/orgs","repos_url":"https://api.github.com/users/ant-design/repos","events_url":"https://api.github.com/users/ant-design/events{/privacy}","received_events_url":"https://api.github.com/users/ant-design/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ant-design/ant-design","description":"🐜 A UI Design Language","fork":false,"url":"https://api.github.com/repos/ant-design/ant-design","forks_url":"https://api.github.com/repos/ant-design/ant-design/forks","keys_url":"https://api.github.com/repos/ant-design/ant-design/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ant-design/ant-design/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ant-design/ant-design/teams","hooks_url":"https://api.github.com/repos/ant-design/ant-design/hooks","issue_events_url":"https://api.github.com/repos/ant-design/ant-design/issues/events{/number}","events_url":"https://api.github.com/repos/ant-design/ant-design/events","assignees_url":"https://api.github.com/repos/ant-design/ant-design/assignees{/user}","branches_url":"https://api.github.com/repos/ant-design/ant-design/branches{/branch}","tags_url":"https://api.github.com/repos/ant-design/ant-design/tags","blobs_url":"https://api.github.com/repos/ant-design/ant-design/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ant-design/ant-design/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ant-design/ant-design/git/refs{/sha}","trees_url":"https://api.github.com/repos/ant-design/ant-design/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ant-design/ant-design/statuses/{sha}","languages_url":"https://api.github.com/repos/ant-design/ant-design/languages","stargazers_url":"https://api.github.com/repos/ant-design/ant-design/stargazers","contributors_url":"https://api.github.com/repos/ant-design/ant-design/contributors","subscribers_url":"https://api.github.com/repos/ant-design/ant-design/subscribers","subscription_url":"https://api.github.com/repos/ant-design/ant-design/subscription","commits_url":"https://api.github.com/repos/ant-design/ant-design/commits{/sha}","git_commits_url":"https://api.github.com/repos/ant-design/ant-design/git/commits{/sha}","comments_url":"https://api.github.com/repos/ant-design/ant-design/comments{/number}","issue_comment_url":"https://api.github.com/repos/ant-design/ant-design/issues/comments{/number}","contents_url":"https://api.github.com/repos/ant-design/ant-design/contents/{+path}","compare_url":"https://api.github.com/repos/ant-design/ant-design/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ant-design/ant-design/merges","archive_url":"https://api.github.com/repos/ant-design/ant-design/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ant-design/ant-design/downloads","issues_url":"https://api.github.com/repos/ant-design/ant-design/issues{/number}","pulls_url":"https://api.github.com/repos/ant-design/ant-design/pulls{/number}","milestones_url":"https://api.github.com/repos/ant-design/ant-design/milestones{/number}","notifications_url":"https://api.github.com/repos/ant-design/ant-design/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ant-design/ant-design/labels{/name}","releases_url":"https://api.github.com/repos/ant-design/ant-design/releases{/id}","deployments_url":"https://api.github.com/repos/ant-design/ant-design/deployments","created_at":"2015-04-24T15:37:24Z","updated_at":"2018-02-24T09:32:58Z","pushed_at":"2018-02-24T03:47:27Z","git_url":"git://github.com/ant-design/ant-design.git","ssh_url":"git@github.com:ant-design/ant-design.git","clone_url":"https://github.com/ant-design/ant-design.git","svn_url":"https://github.com/ant-design/ant-design","homepage":"http://ant.design","size":226898,"stargazers_count":24536,"watchers_count":24536,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":6985,"mirror_url":null,"archived":false,"open_issues_count":167,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":6985,"open_issues":167,"watchers":24536,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ant-design/ant-design/pulls/9408"},"html":{"href":"https://github.com/ant-design/ant-design/pull/9408"},"issue":{"href":"https://api.github.com/repos/ant-design/ant-design/issues/9408"},"comments":{"href":"https://api.github.com/repos/ant-design/ant-design/issues/9408/comments"},"review_comments":{"href":"https://api.github.com/repos/ant-design/ant-design/pulls/9408/comments"},"review_comment":{"href":"https://api.github.com/repos/ant-design/ant-design/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ant-design/ant-design/pulls/9408/commits"},"statuses":{"href":"https://api.github.com/repos/ant-design/ant-design/statuses/06ff0d44db70f8b5e89fc789a674d8a870aa9905"}},"author_association":"NONE","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":8,"additions":470,"deletions":350,"changed_files":10}}
{"actor":{"display_login":"Hughen"}}