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

> I was thinking matches would just filter on event.target, but I might be missing a subtlety.

Yeah, a rough implement usually looks something like:

``` js
document.addEventListener('click', function(event) {
  var delegateTarget = this
  var currentTarget = event.target.closest('.foo')
  if (!currentTarget) {
    return
  }

  // ...
})
```

---
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-208482387

Received on Monday, 11 April 2016 18:12:39 UTC