Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(event): be robust against incomplete event implementations #1009

merged 1 commit into from
Aug 2, 2022


Copy link

@ph-fritsche ph-fritsche commented Aug 2, 2022


Assign the specific event properties and methods on the events instead of relying on the event constructors.


Some DOM implementations are incomplete. E.g. Jsdom lacks support for PointerEvent and it won't be implemented any time soon.
While initializing the events should be out of scope, events lacking the properties we correctly provide for init makes for a bad user experience and simply assigning the properties seems sufficient.

Closes #926

Return correct modifier state for Alt, Control, Meta and Shift per getModifierState.


Replace the createEvent imported from @testing-library/dom with own implementation.


  • Tests
  • Ready to be merged

Copy link

codesandbox-ci bot commented Aug 2, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit cb9e056:

Sandbox Source
userEvent-dom Configuration
userEvent-react Configuration
heuristic-fermi-3hxbd6 Issue #926

Copy link

codecov bot commented Aug 2, 2022

Codecov Report

Merging #1009 (a46b4d7) into main (a46b4d7) will not change coverage.
The diff coverage is n/a.

❗ Current head a46b4d7 differs from pull request most recent head cb9e056. Consider uploading reports for the commit cb9e056 to get more accurate results

@@            Coverage Diff            @@
##              main     #1009   +/-   ##
  Coverage   100.00%   100.00%           
  Files           85        85           
  Lines         2068      2068           
  Branches       709       709           
  Hits          2068      2068           

Help us with your feedback. Take ten seconds to tell us how you rate us.

Copy link

github-actions bot commented Aug 2, 2022

🎉 This PR is included in version 14.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

Successfully merging this pull request may close these issues.

userEvent.pointer does not set the button and buttons properties
1 participant