Fix: trigger not working with some dot.notation modifiers #125
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes an issue with Vue 3 handling modifiers and keyCodes.
It should now allow passing modifiers the same way as you would do with in Vue. Main fixes are general key modifiers and system key modifiers.
trigger('keydown.meta.shift.c')
- will trigger acmd
+shift
+c
event listener.trigger('keydown.13')
- will trigger onenter
only, because keyCode is no longer supported.trigger('click.right')
- will trigger a righclickcontextmenu
event.trigger('click.middle')
- will trigger a middle click event.Context
While writing the docs for form handling I asked myself if we support
trigger('keydown.enter')
syntax, as I am sure we do in VTU 1, hence we have a dedicated test even - https://github.com/vuejs/vue-test-utils/blob/dev/test/specs/wrapper/trigger.spec.js#L73However when I re-implemented the same test in VTU 2, it failed. I tried debugging, the trigger code is pretty much the same as VTU 1. I am not sure what is going on here :/