{"action":"created","issue":{"url":"https://api.github.com/repos/weixiyen/jquery-filedrop/issues/169","labels_url":"https://api.github.com/repos/weixiyen/jquery-filedrop/issues/169/labels{/name}","comments_url":"https://api.github.com/repos/weixiyen/jquery-filedrop/issues/169/comments","events_url":"https://api.github.com/repos/weixiyen/jquery-filedrop/issues/169/events","html_url":"https://github.com/weixiyen/jquery-filedrop/issues/169","id":52157218,"number":169,"title":"RangeError: Maximum call stack size exceeded.","user":{"login":"zedtux","id":478564,"avatar_url":"https://avatars.githubusercontent.com/u/478564?v=3","gravatar_id":"","url":"https://api.github.com/users/zedtux","html_url":"https://github.com/zedtux","followers_url":"https://api.github.com/users/zedtux/followers","following_url":"https://api.github.com/users/zedtux/following{/other_user}","gists_url":"https://api.github.com/users/zedtux/gists{/gist_id}","starred_url":"https://api.github.com/users/zedtux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zedtux/subscriptions","organizations_url":"https://api.github.com/users/zedtux/orgs","repos_url":"https://api.github.com/users/zedtux/repos","events_url":"https://api.github.com/users/zedtux/events{/privacy}","received_events_url":"https://api.github.com/users/zedtux/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-12-16T19:39:57Z","updated_at":"2015-05-15T11:44:36Z","closed_at":null,"body":"Hello,\r\n\r\nFirst of all, this is a very nice plugin ! :+1: \r\n\r\nI have discovered the following bug:\r\n\r\n    Given the file field is placed within the HTML element where `filedrop` is applied\r\n    When user click the drop zone\r\n    Then the error \"RangeError: Maximum call stack size exceeded.\" is raised\r\n\r\nThe issue is that clicking the HTML element fire the `click` event of jquery-filedrop AND the `click` event of the file field.\r\n\r\nMoving it out of the dropzone HTML element solve the issue."},"comment":{"url":"https://api.github.com/repos/weixiyen/jquery-filedrop/issues/comments/102376300","html_url":"https://github.com/weixiyen/jquery-filedrop/issues/169#issuecomment-102376300","issue_url":"https://api.github.com/repos/weixiyen/jquery-filedrop/issues/169","id":102376300,"user":{"login":"boughtonp","id":167122,"avatar_url":"https://avatars.githubusercontent.com/u/167122?v=3","gravatar_id":"","url":"https://api.github.com/users/boughtonp","html_url":"https://github.com/boughtonp","followers_url":"https://api.github.com/users/boughtonp/followers","following_url":"https://api.github.com/users/boughtonp/following{/other_user}","gists_url":"https://api.github.com/users/boughtonp/gists{/gist_id}","starred_url":"https://api.github.com/users/boughtonp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boughtonp/subscriptions","organizations_url":"https://api.github.com/users/boughtonp/orgs","repos_url":"https://api.github.com/users/boughtonp/repos","events_url":"https://api.github.com/users/boughtonp/events{/privacy}","received_events_url":"https://api.github.com/users/boughtonp/received_events","type":"User","site_admin":false},"created_at":"2015-05-15T11:44:36Z","updated_at":"2015-05-15T11:44:36Z","body":"Preventing the original infinite recursion should probably be done by fixing the function on lines 84..86 - to be something like:\r\n\r\n    this.on('click', function(e){\r\n\t\tif ( e.originalEvent.originalTarget.id == opts.fallback_id )\r\n\t\t\treturn;\r\n      $('#' + opts.fallback_id).trigger(e);\r\n    });\r\n\r\n_(untested)_\r\n\r\nIt might also be useful to have a setting which triggers whether this new on click is called at all:\r\n\r\n\tif ( opts.fallback_click_anywhere === true )\r\n\t{\r\n\t\tthis.on('click', function(e){\r\n\t\t\tif ( e.originalEvent.originalTarget.id == 'opts.fallback_id' )\r\n\t\t\t\treturn;\r\n\t\t\t$('#' + opts.fallback_id).trigger(e);\r\n\t\t});\r\n\t}\r\n\r\nWhich would be an easier way to fix the firing twice issue, for anyone with lots of upload controls/buttons but the settings defined in a single place."}}