{"action":"created","issue":{"url":"https://api.github.com/repos/Olical/react-faux-dom/issues/19","labels_url":"https://api.github.com/repos/Olical/react-faux-dom/issues/19/labels{/name}","comments_url":"https://api.github.com/repos/Olical/react-faux-dom/issues/19/comments","events_url":"https://api.github.com/repos/Olical/react-faux-dom/issues/19/events","html_url":"https://github.com/Olical/react-faux-dom/issues/19","id":111998265,"number":19,"title":"a problem with on(\"click\",function)","user":{"login":"wuxianliang","id":2120879,"avatar_url":"https://avatars.githubusercontent.com/u/2120879?v=3","gravatar_id":"","url":"https://api.github.com/users/wuxianliang","html_url":"https://github.com/wuxianliang","followers_url":"https://api.github.com/users/wuxianliang/followers","following_url":"https://api.github.com/users/wuxianliang/following{/other_user}","gists_url":"https://api.github.com/users/wuxianliang/gists{/gist_id}","starred_url":"https://api.github.com/users/wuxianliang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wuxianliang/subscriptions","organizations_url":"https://api.github.com/users/wuxianliang/orgs","repos_url":"https://api.github.com/users/wuxianliang/repos","events_url":"https://api.github.com/users/wuxianliang/events{/privacy}","received_events_url":"https://api.github.com/users/wuxianliang/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Olical/react-faux-dom/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"Olical","id":315229,"avatar_url":"https://avatars.githubusercontent.com/u/315229?v=3","gravatar_id":"","url":"https://api.github.com/users/Olical","html_url":"https://github.com/Olical","followers_url":"https://api.github.com/users/Olical/followers","following_url":"https://api.github.com/users/Olical/following{/other_user}","gists_url":"https://api.github.com/users/Olical/gists{/gist_id}","starred_url":"https://api.github.com/users/Olical/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Olical/subscriptions","organizations_url":"https://api.github.com/users/Olical/orgs","repos_url":"https://api.github.com/users/Olical/repos","events_url":"https://api.github.com/users/Olical/events{/privacy}","received_events_url":"https://api.github.com/users/Olical/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2015-10-18T03:13:32Z","updated_at":"2015-11-02T13:55:22Z","closed_at":null,"body":"Dear @Olical \r\nI am using react-faux-dom now to reproduce a bar chart.\r\n```javascript\r\nchart.selectAll(\".bar\")\r\n      .data(data)\r\n      .enter()\r\n        .append(\"rect\")\r\n        .attr(\"class\", \"bar\")\r\n        .attr(\"x\", function(d) { return x(d.tradeDate.slice(5)); })\r\n        .attr(\"width\", x.rangeBand())\r\n        .attr(\"y\", function(d) { return y(d.turnoverVol); })\r\n        .attr(\"height\", function(d) { return height - y(d.turnoverVol); })\r\n        .on(\"click\", function(d, i) {console.log(d);console.log(i)});\r\n```\r\nwhen I click, \"d\" shows undefined, \"i\" shows correctly. I have tried console.log(d) in other attr, they all work well.\r\nAm I wrong with something? How to use new event system? Thank you very much!\r\n\r\nhttp://bl.ocks.org/mbostock/3885304"},"comment":{"url":"https://api.github.com/repos/Olical/react-faux-dom/issues/comments/153022987","html_url":"https://github.com/Olical/react-faux-dom/issues/19#issuecomment-153022987","issue_url":"https://api.github.com/repos/Olical/react-faux-dom/issues/19","id":153022987,"user":{"login":"Olical","id":315229,"avatar_url":"https://avatars.githubusercontent.com/u/315229?v=3","gravatar_id":"","url":"https://api.github.com/users/Olical","html_url":"https://github.com/Olical","followers_url":"https://api.github.com/users/Olical/followers","following_url":"https://api.github.com/users/Olical/following{/other_user}","gists_url":"https://api.github.com/users/Olical/gists{/gist_id}","starred_url":"https://api.github.com/users/Olical/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Olical/subscriptions","organizations_url":"https://api.github.com/users/Olical/orgs","repos_url":"https://api.github.com/users/Olical/repos","events_url":"https://api.github.com/users/Olical/events{/privacy}","received_events_url":"https://api.github.com/users/Olical/received_events","type":"User","site_admin":false},"created_at":"2015-11-02T13:55:22Z","updated_at":"2015-11-02T13:55:22Z","body":"Hey, sorry about that. By failing test I mean adding a test to one of my test files asserting that and on click event with data should provide the correct arguments. That test would fail right now in theory since the arguments aren't being passed, then once we fix it we know the solution is correct, but don't worry I can do it.\r\n\r\nI have been pretty busy recently and have been waiting for my new main development laptop to arrive. That should be at home when I finish work today, so I'll be able to catch up on open source over the next couple of days. I'm on holiday Thursday to Monday too so I may get some done during that time.\r\n\r\nI apologise for the inconvenience, if I have time I'll fix it tonight, but it may have to be tomorrow. The problem will probably be around here just in case you want to take a look https://github.com/Olical/react-faux-dom/blob/898f1a21078683884fb5a578bfd6eb54ebccd25c/src/Element.js#L251-L262 I think maybe it's not always passed a `syntheticEvent` argument. Maybe that's where d3 passes `d` and `i`?"}}