Skip to content

triggering cancelable event causes error #1472

Closed
@sjahns

Description

@sjahns

Version

1.0.0-beta.32

Reproduction link

https://github.com/sjahns/vue-test-utils-issue-event-cancelable

Steps to reproduce

npm install

npm run test:unit

What is expected?

It should not cause an error

What is actually happening?

It does end in an error


This happens due to createDOMEvent() setting all given options on the event object. But cancelable is read only.

To me it looks like the event is created correctly with cancelable:false but createDOMEvent() will also try to set the property.

I found this while testing a component which does:

if(event.cancelable) {
event.preventDefault();
}

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