Skip to content

Better JSX types for form events #4098

@henribru

Description

@henribru

What problem does this feature solve?

Currently the JSX types specify that native input event handlers receive an Event: https://github.com/vuejs/vue-next/blob/8ed3ed6c27b0fb9a1b6994eddc967e42d4b3d4e1/packages/runtime-dom/types/jsx.d.ts#L1210

This is very general compared to the runtime type. As an example, @input on an input element will actually give you an InputEvent. It would be useful if the correct event type could be inferred so that we don't have to cast the event object. I assume it's not as simple as e.g. replacing Event with InputEvent for onInput or it would probably have been done already, but is this something that could potentially be solved?

What does the proposed API look like?

N/A, just a type improvement, not an API

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