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

Update PointerEvent to have default width / height set to 1 #1224

Merged
merged 3 commits into from
Jan 21, 2025

Conversation

chuganzy
Copy link
Contributor

@chuganzy chuganzy commented Jun 11, 2024

What:

This PR updates PointerEvent to have default width / height set to 1 as per the spec.

Why:

new PointerEvent('xxx') on most browser implementations should set them 1 by default.

Also some libraries check if a pointer event is virtual or not by looking at the geometry values, while we expect this library to work exactly as the actual interactions.

How:

Just use 1 as default values on them.

Checklist:

  • Documentation
    • Not needed?
  • Tests
  • Ready to be merged

Copy link

codesandbox-ci bot commented Jun 11, 2024

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.

@chuganzy chuganzy changed the title Use the original geometry in event if exist Update PointerEvent to have default width / height set to 1 Jun 11, 2024
@devongovett
Copy link
Contributor

Any chance this PR could be merged? This affects pointer event handling by React Aria, which checks width / height to determine if events are coming from virtual clicks (e.g. screen readers).

@ph-fritsche ph-fritsche merged commit f0468d0 into testing-library:main Jan 21, 2025
3 checks passed
Copy link

🎉 This PR is included in version 14.6.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@chuganzy
Copy link
Contributor Author

Thank you for the release!

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.

3 participants