Skip to content

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

Merged
ph-fritsche merged 3 commits intotesting-library:mainfrom
chuganzy:pointer-geometry
Jan 21, 2025
Merged

Update PointerEvent to have default width / height set to 1#1224
ph-fritsche merged 3 commits intotesting-library:mainfrom
chuganzy:pointer-geometry

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

@codesandbox-ci
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
@github-actions
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