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(keyboard): trigger onChange in React #626

Merged
merged 2 commits into from Mar 25, 2021
Merged

fix(keyboard): trigger onChange in React #626

merged 2 commits into from Mar 25, 2021

Conversation

ph-fritsche
Copy link
Member

What:

Change element properties while hiding the change from React.

Why:

Closes #624

How:

React keeps track of properties by replacing the PropertyDescriptor.
We replace the PropertyDescriptor with the native one before setting the property and reapply React's PropertyDescriptor afterwards.
This way React should detect the value on the input event as a new value and dispatch a SyntheticEvent for onChange.

Checklist:

  • N/A Documentation
  • Tests
  • Ready to be merged

@codecov
Copy link

codecov bot commented Mar 25, 2021

Codecov Report

Merging #626 (c9c1cd5) into master (cd34b14) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #626   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           48        48           
  Lines          877       885    +8     
  Branches       345       347    +2     
=========================================
+ Hits           877       885    +8     
Impacted Files Coverage Δ
src/keyboard/shared/fireInputEvent.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 cd34b14...c9c1cd5. Read the comment docs.

@ph-fritsche ph-fritsche changed the title fix: trigger onChange in React fix(keyboard): trigger onChange in React Mar 25, 2021
@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 c9c1cd5:

Sandbox Source
userEvent-PR-template Configuration

@ph-fritsche ph-fritsche merged commit 3db892f into master Mar 25, 2021
@ph-fritsche ph-fritsche deleted the fix-624 branch March 25, 2021 13:30
@github-actions
Copy link

🎉 This PR is included in version 13.0.15 🎉

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

Successfully merging this pull request may close these issues.

13.0.13 no longer triggering onChange event handler when calling userEvent.type
1 participant