user-event icon indicating copy to clipboard operation
user-event copied to clipboard

Update PointerEvent to have default width / height set to 1

Open chuganzy opened this issue 1 year ago • 1 comments

What:

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

  • https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/width
  • https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/height

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:

  • [x] Documentation
    • Not needed?
  • [x] Tests
  • [x] Ready to be merged

chuganzy avatar Jun 11 '24 17:06 chuganzy

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.

codesandbox-ci[bot] avatar Jun 11 '24 17:06 codesandbox-ci[bot]

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).

devongovett avatar Jan 16 '25 23:01 devongovett

:tada: This PR is included in version 14.6.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] avatar Jan 21 '25 17:01 github-actions[bot]

Thank you for the release!

chuganzy avatar Jan 22 '25 03:01 chuganzy