{"action":"opened","issue":{"url":"https://api.github.com/repos/cyclejs/cycle-dom/issues/87","labels_url":"https://api.github.com/repos/cyclejs/cycle-dom/issues/87/labels{/name}","comments_url":"https://api.github.com/repos/cyclejs/cycle-dom/issues/87/comments","events_url":"https://api.github.com/repos/cyclejs/cycle-dom/issues/87/events","html_url":"https://github.com/cyclejs/cycle-dom/issues/87","id":124543799,"number":87,"title":"Event delegation issues in v8.1.0","user":{"login":"staltz","id":90512,"avatar_url":"https://avatars.githubusercontent.com/u/90512?v=3","gravatar_id":"","url":"https://api.github.com/users/staltz","html_url":"https://github.com/staltz","followers_url":"https://api.github.com/users/staltz/followers","following_url":"https://api.github.com/users/staltz/following{/other_user}","gists_url":"https://api.github.com/users/staltz/gists{/gist_id}","starred_url":"https://api.github.com/users/staltz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/staltz/subscriptions","organizations_url":"https://api.github.com/users/staltz/orgs","repos_url":"https://api.github.com/users/staltz/repos","events_url":"https://api.github.com/users/staltz/events{/privacy}","received_events_url":"https://api.github.com/users/staltz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-01T12:54:39Z","updated_at":"2016-01-01T12:54:39Z","closed_at":null,"body":"> I just notices you have implemented event delegation in cycle dom. I did not took a close look yet but I noticed it because 8.1.0 broke my app :smile: I used `event.currentTarget` in various places which now gives me a different element since the listener is bound to the drivers root and not to the element itself. Replacing `currentTarget` with `target` made most of my app working again. But one problem remains: If I use `DOM.select('.myElement').events('click')` and my markup looks like: `div('.myElement', [div('.someChild', 'Hello'), div('.otherChild', 'world')])` the clicks are not recognized if they are targeted at \"Hello\" or \"World\" because then event.target is not `.myElement` but `.someChild` thus is not matched by the `.myElement` selector (But it's parent would match it so the event should be accepted). This concerns all listeners on elements which have child elements. I will take a closer look tomorrow and will create a proper issue. \r\nAnyway I am excited that there is progress regarding the listener rebinding :+1:\r\n> I think `event.target` is not affected by the event phase. If I am correct for mouse events `target` is always the deepest node in the tree for which `pointer-events` is not `none`. Capture and Bubble phases happen after `event.target` is already determined.\r\n> Currently most (probably even all) of my cases could be fixed by setting `pointer-events` to `none` for all my child elements. But I think the correct way of handling it would be to not only check `evt.target` itself but all it's ancestors at https://github.com/cyclejs/cycle-dom/blob/master/src/render-dom.js#L132-L133\r\n> I think jQuery even overwrites the event's currentTarget property during it's event dispatching to make the event delegation mostly transparent from the listeners point of view"}}