Skip to content

EVENT: Use a query selector for the element spec #6

@pauleveritt

Description

@pauleveritt

In the proposal, you might write: @handler( event="mousemove", element=Element("empty_button").element )

Instead, I propose allowing element: Element | str. If it is a string, then use document.querySelector. This would have a few benefits:

  • It's nicer. 😀
  • It doesn't require evaluation at import time.
  • It could match multiple nodes and attach handlers to them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions