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): assign pointer coords to MouseEvent #1039

Merged
merged 1 commit into from
Jan 15, 2025
Merged

fix(event): assign pointer coords to MouseEvent #1039

merged 1 commit into from
Jan 15, 2025

Conversation

ph-fritsche
Copy link
Member

What:

Assign missing pointer coords.

Why:

Closes #1037

Checklist:

  • Tests
  • Ready to be merged

@codesandbox-ci
Copy link

codesandbox-ci bot commented Aug 18, 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 8c6f68e:

Sandbox Source
eager-matsumoto-3r7zr9 Issue #1037

@codecov
Copy link

codecov bot commented Aug 18, 2022

Codecov Report

Merging #1039 (d5a2f34) into main (1aa2027) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##              main     #1039   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           88        88           
  Lines         2061      2061           
  Branches       691       701   +10     
=========================================
  Hits          2061      2061           
Impacted Files Coverage Δ
src/event/createEvent.ts 100.00% <ø> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@liamcmitchell-sc
Copy link

Note this fix may break with future JSDOM versions:

jestjs/jest#13825 (comment)

@ph-fritsche
Copy link
Member Author

@liamcmitchell-sc The properties are assigned as a getter per Object.defineProperty.

function assignProps<T extends object>(obj: T, props: {[k in keyof T]?: T[k]}) {
for (const [key, value] of Object.entries(props)) {
Object.defineProperty(obj, key, {get: () => value ?? null})
}
}

@liamcmitchell-sc
Copy link

@ph-fritsche ah thanks, didn't get that deep.

@ph-fritsche ph-fritsche merged commit 8528972 into main Jan 15, 2025
3 checks passed
@ph-fritsche ph-fritsche deleted the fix-1037 branch January 15, 2025 19:35
Copy link

🎉 This PR is included in version 14.6.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
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

14.4: pageX and pageY coords are not passed to MouseEvent from pointer() call
2 participants