Re: [whatwg/dom] Event delegation via EventListenerOptions (#215)

Maybe if the API explicitly couples them it would be clearer:
```js
obj.addEventListener(type, (e) => {
  e.target // the actual target
  e.currentTarget // obj
  e.delegateTarget // .baz
}, { delegate: ".baz", ignoreBubbles: true })
```
If `delegate` is not passed `delegateTarget` would return null or the same as `e.target`...

Another thing to consider is whether `ignoreBubbles` should default to true when `delegate` is passed. That might make sense since it's typically what you want to do. We'd still offer `ignoreBubbles` as a standalone primitive so you implement your own `delegate` if you're not happy with Selectors and want XPath or some such.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/215#issuecomment-208894448

Received on Tuesday, 12 April 2016 13:04:12 UTC