{"action":"created","comment":{"url":"https://api.github.com/repos/react-dropzone/react-dropzone/pulls/comments/224964666","pull_request_review_id":164468497,"id":224964666,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNDk2NDY2Ng==","diff_hunk":"@@ -243,12 +243,16 @@ class Dropzone extends React.Component {\n \n   onClick(evt) {\n     const { onClick, disableClick } = this.props\n-    if (!disableClick) {\n-      evt.stopPropagation()\n \n-      if (onClick) {\n-        onClick.call(this, evt)\n-      }\n+    // if onClick prop is given, run it first\n+    if (onClick) {\n+      onClick.call(this, evt)\n+    }\n+\n+    // if disableClick is not set and the event hasn't been default prefented within\n+    // the onClick listener, open the file dialog\n+    if (!disableClick && !evt.isDefaultPrevented()) {","path":"src/index.js","position":17,"original_position":17,"commit_id":"500a36cbe272996acfbc573d9337433987a46f7c","original_commit_id":"228e05f539c50889e117fabc72303df201947244","user":{"login":"ibc","id":16191,"node_id":"MDQ6VXNlcjE2MTkx","avatar_url":"https://avatars2.githubusercontent.com/u/16191?v=4","gravatar_id":"","url":"https://api.github.com/users/ibc","html_url":"https://github.com/ibc","followers_url":"https://api.github.com/users/ibc/followers","following_url":"https://api.github.com/users/ibc/following{/other_user}","gists_url":"https://api.github.com/users/ibc/gists{/gist_id}","starred_url":"https://api.github.com/users/ibc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ibc/subscriptions","organizations_url":"https://api.github.com/users/ibc/orgs","repos_url":"https://api.github.com/users/ibc/repos","events_url":"https://api.github.com/users/ibc/events{/privacy}","received_events_url":"https://api.github.com/users/ibc/received_events","type":"User","site_admin":false},"body":"Here you have the requested tests :)","created_at":"2018-10-13T16:29:19Z","updated_at":"2018-10-13T16:29:19Z","html_url":"https://github.com/react-dropzone/react-dropzone/pull/694#discussion_r224964666","pull_request_url":"https://api.github.com/repos/react-dropzone/react-dropzone/pulls/694","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/react-dropzone/react-dropzone/pulls/comments/224964666"},"html":{"href":"https://github.com/react-dropzone/react-dropzone/pull/694#discussion_r224964666"},"pull_request":{"href":"https://api.github.com/repos/react-dropzone/react-dropzone/pulls/694"}},"in_reply_to_id":224961915},"pull_request":{"url":"https://api.github.com/repos/react-dropzone/react-dropzone/pulls/694","id":222652979,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIyNjUyOTc5","html_url":"https://github.com/react-dropzone/react-dropzone/pull/694","diff_url":"https://github.com/react-dropzone/react-dropzone/pull/694.diff","patch_url":"https://github.com/react-dropzone/react-dropzone/pull/694.patch","issue_url":"https://api.github.com/repos/react-dropzone/react-dropzone/issues/694","number":694,"state":"open","locked":false,"title":"fix: improve onClick and disableClick props (fixes #530)","user":{"login":"ibc","id":16191,"node_id":"MDQ6VXNlcjE2MTkx","avatar_url":"https://avatars2.githubusercontent.com/u/16191?v=4","gravatar_id":"","url":"https://api.github.com/users/ibc","html_url":"https://github.com/ibc","followers_url":"https://api.github.com/users/ibc/followers","following_url":"https://api.github.com/users/ibc/following{/other_user}","gists_url":"https://api.github.com/users/ibc/gists{/gist_id}","starred_url":"https://api.github.com/users/ibc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ibc/subscriptions","organizations_url":"https://api.github.com/users/ibc/orgs","repos_url":"https://api.github.com/users/ibc/repos","events_url":"https://api.github.com/users/ibc/events{/privacy}","received_events_url":"https://api.github.com/users/ibc/received_events","type":"User","site_admin":false},"body":"- Make onClick work when disableClick is true\r\n- Check if click event was prevented during onClick\r\n\r\n\r\n**What kind of change does this PR introduce?**\r\n\r\n- [x] bugfix\r\n- [ ] feature\r\n- [ ] refactoring / style\r\n- [ ] build / chore\r\n- [ ] documentation\r\n\r\n**Did you add tests for your changes?**\r\n\r\n- [ ] Yes, my code is well tested\r\n- [x] Not relevant\r\n\r\n**If relevant, did you update the documentation?**\r\n\r\n- [ ] Yes, I've updated the documentation\r\n- [x] Not relevant\r\n\r\n**Summary**\r\n\r\nThis fixes https://github.com/react-dropzone/react-dropzone/issues/530 by making `onClick` prop run even if `disableClick` is set. It also verifies that the click event was not default-prevented during the onClick listener and, if so, it does not open the file selector dialog.\r\n\r\n**Does this PR introduce a breaking change?**\r\n\r\nNo. It conforms to the existing documentation API.\r\n","created_at":"2018-10-13T14:21:28Z","updated_at":"2018-10-13T16:29:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dcaaa3c36178bfcc1afd58bbc04616491fbd6e66","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/react-dropzone/react-dropzone/pulls/694/commits","review_comments_url":"https://api.github.com/repos/react-dropzone/react-dropzone/pulls/694/comments","review_comment_url":"https://api.github.com/repos/react-dropzone/react-dropzone/pulls/comments{/number}","comments_url":"https://api.github.com/repos/react-dropzone/react-dropzone/issues/694/comments","statuses_url":"https://api.github.com/repos/react-dropzone/react-dropzone/statuses/500a36cbe272996acfbc573d9337433987a46f7c","head":{"label":"ibc:master","ref":"master","sha":"500a36cbe272996acfbc573d9337433987a46f7c","user":{"login":"ibc","id":16191,"node_id":"MDQ6VXNlcjE2MTkx","avatar_url":"https://avatars2.githubusercontent.com/u/16191?v=4","gravatar_id":"","url":"https://api.github.com/users/ibc","html_url":"https://github.com/ibc","followers_url":"https://api.github.com/users/ibc/followers","following_url":"https://api.github.com/users/ibc/following{/other_user}","gists_url":"https://api.github.com/users/ibc/gists{/gist_id}","starred_url":"https://api.github.com/users/ibc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ibc/subscriptions","organizations_url":"https://api.github.com/users/ibc/orgs","repos_url":"https://api.github.com/users/ibc/repos","events_url":"https://api.github.com/users/ibc/events{/privacy}","received_events_url":"https://api.github.com/users/ibc/received_events","type":"User","site_admin":false},"repo":{"id":152876645,"node_id":"MDEwOlJlcG9zaXRvcnkxNTI4NzY2NDU=","name":"react-dropzone","full_name":"ibc/react-dropzone","private":false,"owner":{"login":"ibc","id":16191,"node_id":"MDQ6VXNlcjE2MTkx","avatar_url":"https://avatars2.githubusercontent.com/u/16191?v=4","gravatar_id":"","url":"https://api.github.com/users/ibc","html_url":"https://github.com/ibc","followers_url":"https://api.github.com/users/ibc/followers","following_url":"https://api.github.com/users/ibc/following{/other_user}","gists_url":"https://api.github.com/users/ibc/gists{/gist_id}","starred_url":"https://api.github.com/users/ibc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ibc/subscriptions","organizations_url":"https://api.github.com/users/ibc/orgs","repos_url":"https://api.github.com/users/ibc/repos","events_url":"https://api.github.com/users/ibc/events{/privacy}","received_events_url":"https://api.github.com/users/ibc/received_events","type":"User","site_admin":false},"html_url":"https://github.com/ibc/react-dropzone","description":"Simple HTML5 drag-drop zone with React.js.","fork":true,"url":"https://api.github.com/repos/ibc/react-dropzone","forks_url":"https://api.github.com/repos/ibc/react-dropzone/forks","keys_url":"https://api.github.com/repos/ibc/react-dropzone/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ibc/react-dropzone/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ibc/react-dropzone/teams","hooks_url":"https://api.github.com/repos/ibc/react-dropzone/hooks","issue_events_url":"https://api.github.com/repos/ibc/react-dropzone/issues/events{/number}","events_url":"https://api.github.com/repos/ibc/react-dropzone/events","assignees_url":"https://api.github.com/repos/ibc/react-dropzone/assignees{/user}","branches_url":"https://api.github.com/repos/ibc/react-dropzone/branches{/branch}","tags_url":"https://api.github.com/repos/ibc/react-dropzone/tags","blobs_url":"https://api.github.com/repos/ibc/react-dropzone/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ibc/react-dropzone/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ibc/react-dropzone/git/refs{/sha}","trees_url":"https://api.github.com/repos/ibc/react-dropzone/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ibc/react-dropzone/statuses/{sha}","languages_url":"https://api.github.com/repos/ibc/react-dropzone/languages","stargazers_url":"https://api.github.com/repos/ibc/react-dropzone/stargazers","contributors_url":"https://api.github.com/repos/ibc/react-dropzone/contributors","subscribers_url":"https://api.github.com/repos/ibc/react-dropzone/subscribers","subscription_url":"https://api.github.com/repos/ibc/react-dropzone/subscription","commits_url":"https://api.github.com/repos/ibc/react-dropzone/commits{/sha}","git_commits_url":"https://api.github.com/repos/ibc/react-dropzone/git/commits{/sha}","comments_url":"https://api.github.com/repos/ibc/react-dropzone/comments{/number}","issue_comment_url":"https://api.github.com/repos/ibc/react-dropzone/issues/comments{/number}","contents_url":"https://api.github.com/repos/ibc/react-dropzone/contents/{+path}","compare_url":"https://api.github.com/repos/ibc/react-dropzone/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ibc/react-dropzone/merges","archive_url":"https://api.github.com/repos/ibc/react-dropzone/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ibc/react-dropzone/downloads","issues_url":"https://api.github.com/repos/ibc/react-dropzone/issues{/number}","pulls_url":"https://api.github.com/repos/ibc/react-dropzone/pulls{/number}","milestones_url":"https://api.github.com/repos/ibc/react-dropzone/milestones{/number}","notifications_url":"https://api.github.com/repos/ibc/react-dropzone/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ibc/react-dropzone/labels{/name}","releases_url":"https://api.github.com/repos/ibc/react-dropzone/releases{/id}","deployments_url":"https://api.github.com/repos/ibc/react-dropzone/deployments","created_at":"2018-10-13T13:50:10Z","updated_at":"2018-10-13T16:27:55Z","pushed_at":"2018-10-13T16:27:53Z","git_url":"git://github.com/ibc/react-dropzone.git","ssh_url":"git@github.com:ibc/react-dropzone.git","clone_url":"https://github.com/ibc/react-dropzone.git","svn_url":"https://github.com/ibc/react-dropzone","homepage":"https://react-dropzone.js.org/","size":2040,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"react-dropzone:master","ref":"master","sha":"b6aab860e34ead8c228573e733c902edabe02054","user":{"login":"react-dropzone","id":31093525,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxMDkzNTI1","avatar_url":"https://avatars0.githubusercontent.com/u/31093525?v=4","gravatar_id":"","url":"https://api.github.com/users/react-dropzone","html_url":"https://github.com/react-dropzone","followers_url":"https://api.github.com/users/react-dropzone/followers","following_url":"https://api.github.com/users/react-dropzone/following{/other_user}","gists_url":"https://api.github.com/users/react-dropzone/gists{/gist_id}","starred_url":"https://api.github.com/users/react-dropzone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/react-dropzone/subscriptions","organizations_url":"https://api.github.com/users/react-dropzone/orgs","repos_url":"https://api.github.com/users/react-dropzone/repos","events_url":"https://api.github.com/users/react-dropzone/events{/privacy}","received_events_url":"https://api.github.com/users/react-dropzone/received_events","type":"Organization","site_admin":false},"repo":{"id":24530655,"node_id":"MDEwOlJlcG9zaXRvcnkyNDUzMDY1NQ==","name":"react-dropzone","full_name":"react-dropzone/react-dropzone","private":false,"owner":{"login":"react-dropzone","id":31093525,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxMDkzNTI1","avatar_url":"https://avatars0.githubusercontent.com/u/31093525?v=4","gravatar_id":"","url":"https://api.github.com/users/react-dropzone","html_url":"https://github.com/react-dropzone","followers_url":"https://api.github.com/users/react-dropzone/followers","following_url":"https://api.github.com/users/react-dropzone/following{/other_user}","gists_url":"https://api.github.com/users/react-dropzone/gists{/gist_id}","starred_url":"https://api.github.com/users/react-dropzone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/react-dropzone/subscriptions","organizations_url":"https://api.github.com/users/react-dropzone/orgs","repos_url":"https://api.github.com/users/react-dropzone/repos","events_url":"https://api.github.com/users/react-dropzone/events{/privacy}","received_events_url":"https://api.github.com/users/react-dropzone/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/react-dropzone/react-dropzone","description":"Simple HTML5 drag-drop zone with React.js.","fork":false,"url":"https://api.github.com/repos/react-dropzone/react-dropzone","forks_url":"https://api.github.com/repos/react-dropzone/react-dropzone/forks","keys_url":"https://api.github.com/repos/react-dropzone/react-dropzone/keys{/key_id}","collaborators_url":"https://api.github.com/repos/react-dropzone/react-dropzone/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/react-dropzone/react-dropzone/teams","hooks_url":"https://api.github.com/repos/react-dropzone/react-dropzone/hooks","issue_events_url":"https://api.github.com/repos/react-dropzone/react-dropzone/issues/events{/number}","events_url":"https://api.github.com/repos/react-dropzone/react-dropzone/events","assignees_url":"https://api.github.com/repos/react-dropzone/react-dropzone/assignees{/user}","branches_url":"https://api.github.com/repos/react-dropzone/react-dropzone/branches{/branch}","tags_url":"https://api.github.com/repos/react-dropzone/react-dropzone/tags","blobs_url":"https://api.github.com/repos/react-dropzone/react-dropzone/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/react-dropzone/react-dropzone/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/react-dropzone/react-dropzone/git/refs{/sha}","trees_url":"https://api.github.com/repos/react-dropzone/react-dropzone/git/trees{/sha}","statuses_url":"https://api.github.com/repos/react-dropzone/react-dropzone/statuses/{sha}","languages_url":"https://api.github.com/repos/react-dropzone/react-dropzone/languages","stargazers_url":"https://api.github.com/repos/react-dropzone/react-dropzone/stargazers","contributors_url":"https://api.github.com/repos/react-dropzone/react-dropzone/contributors","subscribers_url":"https://api.github.com/repos/react-dropzone/react-dropzone/subscribers","subscription_url":"https://api.github.com/repos/react-dropzone/react-dropzone/subscription","commits_url":"https://api.github.com/repos/react-dropzone/react-dropzone/commits{/sha}","git_commits_url":"https://api.github.com/repos/react-dropzone/react-dropzone/git/commits{/sha}","comments_url":"https://api.github.com/repos/react-dropzone/react-dropzone/comments{/number}","issue_comment_url":"https://api.github.com/repos/react-dropzone/react-dropzone/issues/comments{/number}","contents_url":"https://api.github.com/repos/react-dropzone/react-dropzone/contents/{+path}","compare_url":"https://api.github.com/repos/react-dropzone/react-dropzone/compare/{base}...{head}","merges_url":"https://api.github.com/repos/react-dropzone/react-dropzone/merges","archive_url":"https://api.github.com/repos/react-dropzone/react-dropzone/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/react-dropzone/react-dropzone/downloads","issues_url":"https://api.github.com/repos/react-dropzone/react-dropzone/issues{/number}","pulls_url":"https://api.github.com/repos/react-dropzone/react-dropzone/pulls{/number}","milestones_url":"https://api.github.com/repos/react-dropzone/react-dropzone/milestones{/number}","notifications_url":"https://api.github.com/repos/react-dropzone/react-dropzone/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/react-dropzone/react-dropzone/labels{/name}","releases_url":"https://api.github.com/repos/react-dropzone/react-dropzone/releases{/id}","deployments_url":"https://api.github.com/repos/react-dropzone/react-dropzone/deployments","created_at":"2014-09-27T11:57:09Z","updated_at":"2018-10-13T16:16:52Z","pushed_at":"2018-10-13T16:27:54Z","git_url":"git://github.com/react-dropzone/react-dropzone.git","ssh_url":"git@github.com:react-dropzone/react-dropzone.git","clone_url":"https://github.com/react-dropzone/react-dropzone.git","svn_url":"https://github.com/react-dropzone/react-dropzone","homepage":"https://react-dropzone.js.org/","size":2044,"stargazers_count":4907,"watchers_count":4907,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":507,"mirror_url":null,"archived":false,"open_issues_count":21,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":507,"open_issues":21,"watchers":4907,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/react-dropzone/react-dropzone/pulls/694"},"html":{"href":"https://github.com/react-dropzone/react-dropzone/pull/694"},"issue":{"href":"https://api.github.com/repos/react-dropzone/react-dropzone/issues/694"},"comments":{"href":"https://api.github.com/repos/react-dropzone/react-dropzone/issues/694/comments"},"review_comments":{"href":"https://api.github.com/repos/react-dropzone/react-dropzone/pulls/694/comments"},"review_comment":{"href":"https://api.github.com/repos/react-dropzone/react-dropzone/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/react-dropzone/react-dropzone/pulls/694/commits"},"statuses":{"href":"https://api.github.com/repos/react-dropzone/react-dropzone/statuses/500a36cbe272996acfbc573d9337433987a46f7c"}},"author_association":"NONE"}}
{"actor":{"display_login":"ibc"}}