-
Notifications
You must be signed in to change notification settings - Fork 665
Closed
Labels
Description
I have a listener like this:
<input @keydown.enter.prevent="enter">
And dispatch the event like this:
wrapper.trigger('keydown.enter', {
preventDefault: true
})
And get the following error
Uncaught TypeError: $event.preventDefault is not a function
It iterates over all options and set them:
https://github.com/vuejs/vue-test-utils/blob/dev/src/wrappers/wrapper.js#L533
preventDefault should not be set to true. Suggest either changing the option name to a non conflicting one, or removing it from the iterated keys. Or set it to a noop function.
I know I am doing preventDefault twice, but it shouldn't fail anyway imo.