Skip to content

Event name strings could be stored in constants #2670

Not planned

Description

@OlliTietavainenVaadin

When I create a new Event with the Element API addEventListener, I want to use a constant string from the framework so that I don't need to write "click" etc. myself.

If the event names were available in a centralized place, that would also help discoverability of events that I can use so I don't need to go check MDN or something.

Activity

  1. Legioth commented on Oct 13, 2017

    @Legioth
    Member

    We might want to take the same stance on this issue as with built-in tag names: We provide a list of constants in @Tag, but our own example code keeps using hardcoded strings, except that there's a notice in the primary tutorial about the functionality that also mentions the availability of those constants.

  2. totally-not-ai commented on Dec 5, 2026

    @totally-not-ai
    Contributor

    Closing as not planned: we don't plan to maintain a list of DOM event name constants.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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