{"action":"created","issue":{"url":"https://api.github.com/repos/vitalets/angular-xeditable/issues/267","labels_url":"https://api.github.com/repos/vitalets/angular-xeditable/issues/267/labels{/name}","comments_url":"https://api.github.com/repos/vitalets/angular-xeditable/issues/267/comments","events_url":"https://api.github.com/repos/vitalets/angular-xeditable/issues/267/events","html_url":"https://github.com/vitalets/angular-xeditable/issues/267","id":65400288,"number":267,"title":"Multiple previous shown editable still shown after new editable activated","user":{"login":"petrabarus","id":523289,"avatar_url":"https://avatars.githubusercontent.com/u/523289?v=3","gravatar_id":"","url":"https://api.github.com/users/petrabarus","html_url":"https://github.com/petrabarus","followers_url":"https://api.github.com/users/petrabarus/followers","following_url":"https://api.github.com/users/petrabarus/following{/other_user}","gists_url":"https://api.github.com/users/petrabarus/gists{/gist_id}","starred_url":"https://api.github.com/users/petrabarus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petrabarus/subscriptions","organizations_url":"https://api.github.com/users/petrabarus/orgs","repos_url":"https://api.github.com/users/petrabarus/repos","events_url":"https://api.github.com/users/petrabarus/events{/privacy}","received_events_url":"https://api.github.com/users/petrabarus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-03-31T08:50:30Z","updated_at":"2015-12-08T07:39:04Z","closed_at":null,"body":"I'm experiencing something weird. In the demo page, whenever an editable shown, the other was closed.\r\n\r\nBut in my case it isn't.\r\n\r\n![screenshot from 2015-03-31 14 59 02](https://cloud.githubusercontent.com/assets/523289/6915159/060c0f32-d7bc-11e4-86cf-4c1d7bd6ddbd.png)\r\n\r\nSo I tried debugging the source code.\r\n\r\nThe part `e.isDefaultPrevented()` in this [line](https://github.com/vitalets/angular-xeditable/blob/master/dist/js/xeditable.js#L1007)\r\n\r\n```\r\n // bind click to body: cancel|submit|ignore forms\r\n$document.bind('click', function(e) {\r\n    // ignore right/middle button click\r\n    if ((e.which && e.which !== 1) || e.isDefaultPrevented()) {\r\n        return;\r\n    }\r\n    var toCancel = [];\r\n    var toSubmit = [];\r\n```\r\n\r\nprevent all other editable closed. \r\n\r\nSo I tried removing the `e.isDefaultPrevented()` part, the editables all work fine (i.e. there is only one shown at a moment).\r\n\r\nThen I tried debugging to find which part is the culprit by finding who called the `e.preventDefault()`, using [this](http://stackoverflow.com/questions/20490931/how-to-find-what-is-causing-a-preventdefault-which-overides-normal-click-behavio).\r\n\r\n```\r\nvar oldEPD = Event.prototype.preventDefault;\r\nEvent.prototype.preventDefault = function() {\r\n    debugger;\r\n    oldEPD.call(this);\r\n};\r\n```\r\n\r\nHere's what I found in the debugger\r\n\r\n![screenshot from 2015-03-31 15 47 53](https://cloud.githubusercontent.com/assets/523289/6915361/7de1f8b8-d7bd-11e4-8e41-110becc9a0ab.png)\r\n\r\nwhich is this [line](https://github.com/vitalets/angular-xeditable/blob/master/dist/js/xeditable.js#L950)\r\n\r\nAm I doing something wrong? Thanks!\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/vitalets/angular-xeditable/issues/comments/162801827","html_url":"https://github.com/vitalets/angular-xeditable/issues/267#issuecomment-162801827","issue_url":"https://api.github.com/repos/vitalets/angular-xeditable/issues/267","id":162801827,"user":{"login":"rahmatawaludin","id":1274849,"avatar_url":"https://avatars.githubusercontent.com/u/1274849?v=3","gravatar_id":"","url":"https://api.github.com/users/rahmatawaludin","html_url":"https://github.com/rahmatawaludin","followers_url":"https://api.github.com/users/rahmatawaludin/followers","following_url":"https://api.github.com/users/rahmatawaludin/following{/other_user}","gists_url":"https://api.github.com/users/rahmatawaludin/gists{/gist_id}","starred_url":"https://api.github.com/users/rahmatawaludin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rahmatawaludin/subscriptions","organizations_url":"https://api.github.com/users/rahmatawaludin/orgs","repos_url":"https://api.github.com/users/rahmatawaludin/repos","events_url":"https://api.github.com/users/rahmatawaludin/events{/privacy}","received_events_url":"https://api.github.com/users/rahmatawaludin/received_events","type":"User","site_admin":false},"created_at":"2015-12-08T07:39:04Z","updated_at":"2015-12-08T07:39:04Z","body":"Hi, I'm experiencing this too. As far I can see, the sample use different controller, right?"}}