Repository navigation
fix: allow plain objects for typed event properties in trigger - #3043
Merged
cexbrayat merged 2 commits intoNov 25, 2026
Merged
Conversation
👷 Deploy request for vue-test-utils-docs pending review.Visit the deploys page to approve it
|
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
triggerpasses its options to the event constructor. Browsers reject plain objects for typed init members, so this throws in a real browser (e.g. Vitest Browser Mode, which this repo now also runs):Same for
clipboardData,touches/changedTouches/targetTouchesandsource/ports. jsdom accepts these, but it also rejects a plain object asrelatedTargetorview.If the constructor throws, the event is now created without the plain object and array values it rejects, and those are then defined on the event. Otherwise nothing changes: native values (a real
DataTransfer, an element asrelatedTarget) still go through the constructor, and a wrapper passed by mistake asrelatedTargetstill throws.Real tests doing this: element-plus, tdesign-vue-next, activist.
Playground (2.6.0): play.vuejs.org