testing-library / user-event

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

fix: PointerEvent button and buttons set to incorrect values; fixes #1083 #1219

Open illandril opened 4 months ago

illandril commented 4 months ago

What:

Set button and buttons values appropriately for PointerEvent (https://github.com/testing-library/user-event/issues/1083)

Why:

Allows PointerEvent handlers that rely on button and/or buttons values to be properly tested

How:

Keep track of the buttons state in Pointer in a way that mimics browser behavior

Checklist:

codesandbox-ci[bot] commented 4 months 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.