-
Notifications
You must be signed in to change notification settings - Fork 252
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
14.4: pageX and pageY coords are not passed to MouseEvent from pointer() call #1037
Comments
Note that from JSDOM@22 pageX/Y/offsetX/Y will alias to clientX/Y until layout support is added: You can do this yourself as a workaround: Object.defineProperties(MouseEvent.prototype, {
pageX: {
get() {
return this.clientX
},
},
pageY: {
get() {
return this.clientY
},
}
}) Then use x and y in pointer actions: await user.pointer({
coords: { x: 100, y: 100 }
}) Using x/y instead of clientX/clientY because of #1139 |
This is still broken as of 14.5.1. In fact, it's even more broken as the default state is now 2852509#diff-3efbb708c7e683da7e8bed053d5b386baa2bf8489e799d1a931db3c4299910c2L43 |
🎉 This issue has been resolved in version 14.6.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Reproduction example
https://codesandbox.io/s/heuristic-lake-3rk90q?file=/src/App.js
Prerequisites
MouseEvent
and log thepageX
andpageY
properties of the event (as specified in the docs)user.pointer
event with additionalpageX
andpageY
coords passed likeawait user.pointer({target: anyTarget, coords: { pageX: 100, pageY: 100 }})
pageX
andpageY
.Expected behavior
The properties are properly passed to the mouse event and get logged correctly.
Works correctly in 14.3.
Actual behavior
The value of these properties is
undefined
.Broken as of 14.4.0.
User-event version
14.4.3
Environment
See sandbox
Additional context
When the
assignProps
was changed in this commit, those two properties were omitted.The text was updated successfully, but these errors were encountered: