{"action":"created","issue":{"url":"https://api.github.com/repos/lhorie/mithril.js/issues/1385","repository_url":"https://api.github.com/repos/lhorie/mithril.js","labels_url":"https://api.github.com/repos/lhorie/mithril.js/issues/1385/labels{/name}","comments_url":"https://api.github.com/repos/lhorie/mithril.js/issues/1385/comments","events_url":"https://api.github.com/repos/lhorie/mithril.js/issues/1385/events","html_url":"https://github.com/lhorie/mithril.js/issues/1385","id":187195450,"number":1385,"title":"[rewrite] Event handlers not removed correctly from DOM","user":{"login":"valtron","id":123696,"avatar_url":"https://avatars.githubusercontent.com/u/123696?v=3","gravatar_id":"","url":"https://api.github.com/users/valtron","html_url":"https://github.com/valtron","followers_url":"https://api.github.com/users/valtron/followers","following_url":"https://api.github.com/users/valtron/following{/other_user}","gists_url":"https://api.github.com/users/valtron/gists{/gist_id}","starred_url":"https://api.github.com/users/valtron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/valtron/subscriptions","organizations_url":"https://api.github.com/users/valtron/orgs","repos_url":"https://api.github.com/users/valtron/repos","events_url":"https://api.github.com/users/valtron/events{/privacy}","received_events_url":"https://api.github.com/users/valtron/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-03T21:29:20Z","updated_at":"2016-11-04T09:34:30Z","closed_at":null,"body":"### Description:\r\n\r\nSomething's going wrong when events are removed on redraw: `undefined` passed in [updateAttrs](https://github.com/lhorie/mithril.js/blob/bc0a75a6a20f1cbefe0c58b7b2f1687f34a7746d/render/render.js#L458), and used in [updateEvent](https://github.com/lhorie/mithril.js/blob/bc0a75a6a20f1cbefe0c58b7b2f1687f34a7746d/render/render.js#L499). Problem might be the `if (key in element) ...` line.\r\n\r\n### Steps to Reproduce:\r\n\r\n1. Go to http://codepen.io/bugmenot/pen/NbWNjq\r\n2. Open dev console\r\n3. Click twice on \"Click Twice Here\"\r\n4. Click on \"Then Click Here\"\r\n\r\n### Expected:\r\n\r\n\"divclick\" should be printed to console. No error should be thrown.\r\n\r\n### Actual:\r\n\r\nError thrown:\r\n\r\n```\r\nmithril.min.js:33 Uncaught TypeError: Cannot read property 'call' of undefined\r\n```"},"comment":{"url":"https://api.github.com/repos/lhorie/mithril.js/issues/comments/258382639","html_url":"https://github.com/lhorie/mithril.js/issues/1385#issuecomment-258382639","issue_url":"https://api.github.com/repos/lhorie/mithril.js/issues/1385","id":258382639,"user":{"login":"pygy","id":54515,"avatar_url":"https://avatars.githubusercontent.com/u/54515?v=3","gravatar_id":"","url":"https://api.github.com/users/pygy","html_url":"https://github.com/pygy","followers_url":"https://api.github.com/users/pygy/followers","following_url":"https://api.github.com/users/pygy/following{/other_user}","gists_url":"https://api.github.com/users/pygy/gists{/gist_id}","starred_url":"https://api.github.com/users/pygy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pygy/subscriptions","organizations_url":"https://api.github.com/users/pygy/orgs","repos_url":"https://api.github.com/users/pygy/repos","events_url":"https://api.github.com/users/pygy/events{/privacy}","received_events_url":"https://api.github.com/users/pygy/received_events","type":"User","site_admin":false},"created_at":"2016-11-04T09:34:30Z","updated_at":"2016-11-04T09:34:30Z","body":"Your analysis looks correct. This [only affects events that can be set inline](https://github.com/lhorie/mithril.js/blob/bc0a75a6a20f1cbefe0c58b7b2f1687f34a7746d/render/render.js#L503) on (real DOM) elements as `onfoo=...`.\r\n\r\nEvents that require `addEventListener` are not affected."}}
{"actor":{"display_login":"pygy"}}