Skip to content

Where to fire toolactivated and toolcanceled events? #126

@domfarolino

Description

@domfarolino

The declarative API explainer introduces the toolactivated and toolcanceled events, leaves the issue of where to fire the events for future discussion. This is that discussion. The explainer initially mentions firing the events at the Window object, however in #76 (comment), @bwalderman mentions that it might make more sense to fire these events at the <form> element itself that is the declarative tool itself.

Initially this makes sense, but if we extend these events to imperative tools, the firing location becomes confusing. For declarative, they'd fire at the element itself, but for imperative they'd fire at Window which feels odd. I think if we had a dedicated Tool interface that inherited from EventTarget to represent imperative tools, then we could have a policy of always firing the events on the tool itself. But absent this, it might make sense to fire all events at the Window and call it a day.

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions