Re: [whatwg/dom] Removing event listeners through an identifier (#208)

@annevk Hm.. `once` and `passive` are not included in the key right now, either. So doing the same for `group` would be consistent in that regard.

On the other hand,  both of these options are relatively new, and both are the only two options in existence right now that don't modify behaviour of the handler itself (`capture` and `type` are unquestionably a different handler, to the point they could make sense as separate methods, like `addClickHandler` or `addCaptureHandler`).

I wonder if in the previous specification of `once` and/or `passive` there was any consideration with regards to the uniqueness/de-duplication key? If it wasn't explicitly discussed, I don't think we can consider absence of these two options in the key as predicate to keep doing the same going forward. It may've been just left untouched unintentionally, on the assumption that re-use of the same function object is rare anyway. If we have that conversation now, it could very well lead to a change in the spec to consider these two options as part of the key as well.

I would expect that to be a low risk in terms of web-compat.

It's only now with grouping that we observe potential user confusion and use cases for one way or the other. Although I see now what @LeaVerou meant. If we take away support for 1-to-many association (multiple groups), this problem/question won't exist. Users would naturally hit the silent ignore of addEventListener when adding a second version, as they do now.

```js
el.addEventListener("type", cb, { once: true });
el.addEventListener("type", cb); // ignored
```

-- 
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/208#issuecomment-311815422

Received on Wednesday, 28 June 2017 23:00:25 UTC