testing-library / user-event

🐕 Simulate user events
https://testing-library.com/user-event
MIT License
2.14k stars 242 forks source link

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

Open chuganzy opened 2 weeks ago

chuganzy commented 2 weeks ago

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:

codesandbox-ci[bot] commented 2 weeks ago

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.