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: set KeyboardEvent.charCode on keypress #771

Merged
merged 2 commits into from
Oct 30, 2021
Merged

fix: set KeyboardEvent.charCode on keypress #771

merged 2 commits into from
Oct 30, 2021

Conversation

ph-fritsche
Copy link
Member

What:

Set KeyboardEvent.charCode when dispatching keypress.

Why:

React does not create Synthetic keypress events if charCode is not set.

Closes #766

Checklist:

  • Tests
  • Ready to be merged

@ph-fritsche ph-fritsche added this to the userEvent v14 milestone Oct 29, 2021
@ph-fritsche ph-fritsche linked an issue Oct 29, 2021 that may be closed by this pull request
@codesandbox-ci
Copy link

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 20f6c76:

Sandbox Source
userEvent-PR-template Configuration
loving-neumann-e6fi9 Issue #766

@codecov
Copy link

codecov bot commented Oct 29, 2021

Codecov Report

Merging #771 (d87b0c9) into alpha (5434f3f) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##             alpha      #771   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           64        64           
  Lines         1303      1304    +1     
  Branches       504       505    +1     
=========================================
+ Hits          1303      1304    +1     
Impacted Files Coverage Δ
src/keyboard/keyboardImplementation.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5434f3f...d87b0c9. Read the comment docs.

@ph-fritsche ph-fritsche merged commit 4f04a3d into alpha Oct 30, 2021
@ph-fritsche ph-fritsche deleted the fix-766 branch October 30, 2021 20:16
@github-actions
Copy link

🎉 This PR is included in version 14.0.0-alpha.5 🎉

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

keyboard() and type() do not trigger onKeyPress for all keys
1 participant