tabatkins / css-toggle

Proposal for a CSS Toggle spec
Creative Commons Zero v1.0 Universal
28 stars 1 forks source link

why are toggles an event target? #32

Closed dbaron closed 2 years ago

dbaron commented 2 years ago

The formal definition of a toggle change event says that they're fired at elements. I think this probably makes sense since it's possible to get the toggle from the element, but a little weirder to get the element from the toggle. It's also a little simpler, since there's no new event target.

However, CSSToggle derives from EventTarget, which made me think that togglechange events were meant to be fired at the toggles rather than the elements.

tabatkins commented 2 years ago

Hm, looks like no particular reason. I must have just anticipated firing the events and so added it on, and not realized when I actually went to write the text that the logical event target was the element instead. Removed.