{"action":"created","comment":{"url":"https://api.github.com/repos/ant-design/ant-design-mobile/pulls/comments/83860450","pull_request_review_id":4675146,"id":83860450,"diff_hunk":"@@ -9,32 +9,38 @@ export default class Radio extends React.Component<RadioProps, any> {\n   constructor(props: RadioProps, context: any) {\n     super(props, context);\n \n-    let checked = 'checked' in props ? props.checked : props.defaultChecked;\n+    let checked;\n+    if (props.checked !== null && props.checked !== undefined) {\n+      checked = !!props.checked;\n+    } else {\n+      checked = !!props.defaultChecked;\n+    }\n     this.state = {\n       checked: checked,\n     };\n   }\n \n   componentWillReceiveProps(nextProps: RadioProps, nextContext: any): void {\n-    if ('checked' in nextProps) {\n+    if (nextProps.checked !== null && nextProps.checked !== undefined) {\n       const oldChecked = this.state.checked;\n       if (nextProps.checked === oldChecked) {\n         return;\n       }\n       this.setState({\n-        checked: nextProps.checked,\n+        checked: !!nextProps.checked,\n       });\n     }\n   }\n \n   handleClick = () => {\n-    if (this.props.disabled || this.state.checked) {\n+    if (this.props.disabled) {\n       return;\n     }\n-    this.setState({\n-      checked: true,\n-    });\n-\n+    if (this.props.checked === null || this.props.checked === undefined) {\n+      this.setState({\n+        checked: true,","path":"components/radio/Radio.tsx","position":41,"original_position":41,"commit_id":"6f47c36b8e3729674dc63eaaa39cfac05b125f3c","original_commit_id":"6f47c36b8e3729674dc63eaaa39cfac05b125f3c","user":{"login":"pingan1927","id":347649,"avatar_url":"https://avatars.githubusercontent.com/u/347649?v=3","gravatar_id":"","url":"https://api.github.com/users/pingan1927","html_url":"https://github.com/pingan1927","followers_url":"https://api.github.com/users/pingan1927/followers","following_url":"https://api.github.com/users/pingan1927/following{/other_user}","gists_url":"https://api.github.com/users/pingan1927/gists{/gist_id}","starred_url":"https://api.github.com/users/pingan1927/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pingan1927/subscriptions","organizations_url":"https://api.github.com/users/pingan1927/orgs","repos_url":"https://api.github.com/users/pingan1927/repos","events_url":"https://api.github.com/users/pingan1927/events{/privacy}","received_events_url":"https://api.github.com/users/pingan1927/received_events","type":"User","site_admin":false},"body":"这样会导致一个现象，未选中点击可以变为选中，选中点击之后就没有反应了。","created_at":"2016-10-18T14:02:51Z","updated_at":"2016-10-18T14:02:51Z","html_url":"https://github.com/ant-design/ant-design-mobile/pull/392#discussion_r83860450","pull_request_url":"https://api.github.com/repos/ant-design/ant-design-mobile/pulls/392","_links":{"self":{"href":"https://api.github.com/repos/ant-design/ant-design-mobile/pulls/comments/83860450"},"html":{"href":"https://github.com/ant-design/ant-design-mobile/pull/392#discussion_r83860450"},"pull_request":{"href":"https://api.github.com/repos/ant-design/ant-design-mobile/pulls/392"}}},"pull_request":{"url":"https://api.github.com/repos/ant-design/ant-design-mobile/pulls/392","id":89780987,"html_url":"https://github.com/ant-design/ant-design-mobile/pull/392","diff_url":"https://github.com/ant-design/ant-design-mobile/pull/392.diff","patch_url":"https://github.com/ant-design/ant-design-mobile/pull/392.patch","issue_url":"https://api.github.com/repos/ant-design/ant-design-mobile/issues/392","number":392,"state":"open","locked":false,"title":"fix: Checkbox & Radio rn components controllable","user":{"login":"linfaxin","id":3705017,"avatar_url":"https://avatars.githubusercontent.com/u/3705017?v=3","gravatar_id":"","url":"https://api.github.com/users/linfaxin","html_url":"https://github.com/linfaxin","followers_url":"https://api.github.com/users/linfaxin/followers","following_url":"https://api.github.com/users/linfaxin/following{/other_user}","gists_url":"https://api.github.com/users/linfaxin/gists{/gist_id}","starred_url":"https://api.github.com/users/linfaxin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linfaxin/subscriptions","organizations_url":"https://api.github.com/users/linfaxin/orgs","repos_url":"https://api.github.com/users/linfaxin/repos","events_url":"https://api.github.com/users/linfaxin/events{/privacy}","received_events_url":"https://api.github.com/users/linfaxin/received_events","type":"User","site_admin":false},"body":"make Checkbox & Radio rn components controllable.","created_at":"2016-10-18T09:48:54Z","updated_at":"2016-10-18T14:02:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d6278220af8dd51eb9a3e7e9440a51c9c48dabff","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ant-design/ant-design-mobile/pulls/392/commits","review_comments_url":"https://api.github.com/repos/ant-design/ant-design-mobile/pulls/392/comments","review_comment_url":"https://api.github.com/repos/ant-design/ant-design-mobile/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ant-design/ant-design-mobile/issues/392/comments","statuses_url":"https://api.github.com/repos/ant-design/ant-design-mobile/statuses/6f47c36b8e3729674dc63eaaa39cfac05b125f3c","head":{"label":"ant-design:fix_controllable","ref":"fix_controllable","sha":"6f47c36b8e3729674dc63eaaa39cfac05b125f3c","user":{"login":"ant-design","id":12101536,"avatar_url":"https://avatars.githubusercontent.com/u/12101536?v=3","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":47093357,"name":"ant-design-mobile","full_name":"ant-design/ant-design-mobile","owner":{"login":"ant-design","id":12101536,"avatar_url":"https://avatars.githubusercontent.com/u/12101536?v=3","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-mobile","description":"A configurable Mobile UI","fork":false,"url":"https://api.github.com/repos/ant-design/ant-design-mobile","forks_url":"https://api.github.com/repos/ant-design/ant-design-mobile/forks","keys_url":"https://api.github.com/repos/ant-design/ant-design-mobile/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ant-design/ant-design-mobile/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ant-design/ant-design-mobile/teams","hooks_url":"https://api.github.com/repos/ant-design/ant-design-mobile/hooks","issue_events_url":"https://api.github.com/repos/ant-design/ant-design-mobile/issues/events{/number}","events_url":"https://api.github.com/repos/ant-design/ant-design-mobile/events","assignees_url":"https://api.github.com/repos/ant-design/ant-design-mobile/assignees{/user}","branches_url":"https://api.github.com/repos/ant-design/ant-design-mobile/branches{/branch}","tags_url":"https://api.github.com/repos/ant-design/ant-design-mobile/tags","blobs_url":"https://api.github.com/repos/ant-design/ant-design-mobile/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ant-design/ant-design-mobile/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ant-design/ant-design-mobile/git/refs{/sha}","trees_url":"https://api.github.com/repos/ant-design/ant-design-mobile/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ant-design/ant-design-mobile/statuses/{sha}","languages_url":"https://api.github.com/repos/ant-design/ant-design-mobile/languages","stargazers_url":"https://api.github.com/repos/ant-design/ant-design-mobile/stargazers","contributors_url":"https://api.github.com/repos/ant-design/ant-design-mobile/contributors","subscribers_url":"https://api.github.com/repos/ant-design/ant-design-mobile/subscribers","subscription_url":"https://api.github.com/repos/ant-design/ant-design-mobile/subscription","commits_url":"https://api.github.com/repos/ant-design/ant-design-mobile/commits{/sha}","git_commits_url":"https://api.github.com/repos/ant-design/ant-design-mobile/git/commits{/sha}","comments_url":"https://api.github.com/repos/ant-design/ant-design-mobile/comments{/number}","issue_comment_url":"https://api.github.com/repos/ant-design/ant-design-mobile/issues/comments{/number}","contents_url":"https://api.github.com/repos/ant-design/ant-design-mobile/contents/{+path}","compare_url":"https://api.github.com/repos/ant-design/ant-design-mobile/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ant-design/ant-design-mobile/merges","archive_url":"https://api.github.com/repos/ant-design/ant-design-mobile/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ant-design/ant-design-mobile/downloads","issues_url":"https://api.github.com/repos/ant-design/ant-design-mobile/issues{/number}","pulls_url":"https://api.github.com/repos/ant-design/ant-design-mobile/pulls{/number}","milestones_url":"https://api.github.com/repos/ant-design/ant-design-mobile/milestones{/number}","notifications_url":"https://api.github.com/repos/ant-design/ant-design-mobile/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ant-design/ant-design-mobile/labels{/name}","releases_url":"https://api.github.com/repos/ant-design/ant-design-mobile/releases{/id}","deployments_url":"https://api.github.com/repos/ant-design/ant-design-mobile/deployments","created_at":"2015-11-30T03:33:06Z","updated_at":"2016-10-18T10:15:39Z","pushed_at":"2016-10-18T09:48:54Z","git_url":"git://github.com/ant-design/ant-design-mobile.git","ssh_url":"git@github.com:ant-design/ant-design-mobile.git","clone_url":"https://github.com/ant-design/ant-design-mobile.git","svn_url":"https://github.com/ant-design/ant-design-mobile","homepage":"http://mobile.ant.design/","size":37081,"stargazers_count":627,"watchers_count":627,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":76,"mirror_url":null,"open_issues_count":43,"forks":76,"open_issues":43,"watchers":627,"default_branch":"master"}},"base":{"label":"ant-design:master","ref":"master","sha":"93396f362fc243845ae3bd0febb1c15c88ce8709","user":{"login":"ant-design","id":12101536,"avatar_url":"https://avatars.githubusercontent.com/u/12101536?v=3","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":47093357,"name":"ant-design-mobile","full_name":"ant-design/ant-design-mobile","owner":{"login":"ant-design","id":12101536,"avatar_url":"https://avatars.githubusercontent.com/u/12101536?v=3","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-mobile","description":"A configurable Mobile UI","fork":false,"url":"https://api.github.com/repos/ant-design/ant-design-mobile","forks_url":"https://api.github.com/repos/ant-design/ant-design-mobile/forks","keys_url":"https://api.github.com/repos/ant-design/ant-design-mobile/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ant-design/ant-design-mobile/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ant-design/ant-design-mobile/teams","hooks_url":"https://api.github.com/repos/ant-design/ant-design-mobile/hooks","issue_events_url":"https://api.github.com/repos/ant-design/ant-design-mobile/issues/events{/number}","events_url":"https://api.github.com/repos/ant-design/ant-design-mobile/events","assignees_url":"https://api.github.com/repos/ant-design/ant-design-mobile/assignees{/user}","branches_url":"https://api.github.com/repos/ant-design/ant-design-mobile/branches{/branch}","tags_url":"https://api.github.com/repos/ant-design/ant-design-mobile/tags","blobs_url":"https://api.github.com/repos/ant-design/ant-design-mobile/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ant-design/ant-design-mobile/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ant-design/ant-design-mobile/git/refs{/sha}","trees_url":"https://api.github.com/repos/ant-design/ant-design-mobile/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ant-design/ant-design-mobile/statuses/{sha}","languages_url":"https://api.github.com/repos/ant-design/ant-design-mobile/languages","stargazers_url":"https://api.github.com/repos/ant-design/ant-design-mobile/stargazers","contributors_url":"https://api.github.com/repos/ant-design/ant-design-mobile/contributors","subscribers_url":"https://api.github.com/repos/ant-design/ant-design-mobile/subscribers","subscription_url":"https://api.github.com/repos/ant-design/ant-design-mobile/subscription","commits_url":"https://api.github.com/repos/ant-design/ant-design-mobile/commits{/sha}","git_commits_url":"https://api.github.com/repos/ant-design/ant-design-mobile/git/commits{/sha}","comments_url":"https://api.github.com/repos/ant-design/ant-design-mobile/comments{/number}","issue_comment_url":"https://api.github.com/repos/ant-design/ant-design-mobile/issues/comments{/number}","contents_url":"https://api.github.com/repos/ant-design/ant-design-mobile/contents/{+path}","compare_url":"https://api.github.com/repos/ant-design/ant-design-mobile/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ant-design/ant-design-mobile/merges","archive_url":"https://api.github.com/repos/ant-design/ant-design-mobile/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ant-design/ant-design-mobile/downloads","issues_url":"https://api.github.com/repos/ant-design/ant-design-mobile/issues{/number}","pulls_url":"https://api.github.com/repos/ant-design/ant-design-mobile/pulls{/number}","milestones_url":"https://api.github.com/repos/ant-design/ant-design-mobile/milestones{/number}","notifications_url":"https://api.github.com/repos/ant-design/ant-design-mobile/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ant-design/ant-design-mobile/labels{/name}","releases_url":"https://api.github.com/repos/ant-design/ant-design-mobile/releases{/id}","deployments_url":"https://api.github.com/repos/ant-design/ant-design-mobile/deployments","created_at":"2015-11-30T03:33:06Z","updated_at":"2016-10-18T10:15:39Z","pushed_at":"2016-10-18T09:48:54Z","git_url":"git://github.com/ant-design/ant-design-mobile.git","ssh_url":"git@github.com:ant-design/ant-design-mobile.git","clone_url":"https://github.com/ant-design/ant-design-mobile.git","svn_url":"https://github.com/ant-design/ant-design-mobile","homepage":"http://mobile.ant.design/","size":37081,"stargazers_count":627,"watchers_count":627,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":76,"mirror_url":null,"open_issues_count":43,"forks":76,"open_issues":43,"watchers":627,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ant-design/ant-design-mobile/pulls/392"},"html":{"href":"https://github.com/ant-design/ant-design-mobile/pull/392"},"issue":{"href":"https://api.github.com/repos/ant-design/ant-design-mobile/issues/392"},"comments":{"href":"https://api.github.com/repos/ant-design/ant-design-mobile/issues/392/comments"},"review_comments":{"href":"https://api.github.com/repos/ant-design/ant-design-mobile/pulls/392/comments"},"review_comment":{"href":"https://api.github.com/repos/ant-design/ant-design-mobile/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ant-design/ant-design-mobile/pulls/392/commits"},"statuses":{"href":"https://api.github.com/repos/ant-design/ant-design-mobile/statuses/6f47c36b8e3729674dc63eaaa39cfac05b125f3c"}}}}
{"actor":{"display_login":"pingan1927"}}