Skip to content

event.keyCode is deprecated #2096

Open
Open
@justin-lyon

Description

@justin-lyon

Cleanup

What should be cleaned up or changed:
Vue Test Utils trigger does not conform with keyboard event attributes. For the statement wrapper.find('input').trigger('keyup.down') a keyboard event is emitted but the key and code attributes are not properly mapped.

❌ (bad) vue test util console.logs of the two valid attributes key and code with the deprecated attribute keyCode
image

✅ (good) the same three console.logs in the browser
image

🗳️ I suggest conforming to the key and code attributes. keyCode is still out there and dropping support is unrealistic, but these new standards should be supported too.

Provide any links for context:
Vue Test Utils 3 - Form Handling
Vue Test Utils 2 - Testing Key, Mouse, and Other DOM Events
Mozilla Developer Network - Event keyCode

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions