We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
button
buttons
https://codesandbox.io/s/goofy-swanson-03q1nc?file=/src/App.js
<button>Click me</button>
await user.pointer({ keys: '[MouseLeft]', target: screen.getByRole('button') })
await user.pointer({ keys: '[MouseRight]', target: screen.getByRole('button') })
await user.pointer({ keys: '[MouseMiddle]', target: screen.getByRole('button') })
PointerEvent sets event.button and event.buttons correctly.
PointerEvent
event.button
event.buttons
https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events#determining_button_states
Both event.button and event.buttons are always 0.
0
Note: Changing the event to mouseDown gives correct values for the equivalent MouseEvent.
mouseDown
MouseEvent
14.1.1
Testing Library framework:
JS framework:
Test environment:
DOM implementation:
No response
The text was updated successfully, but these errors were encountered:
Any luck on this bug ?
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Reproduction example
https://codesandbox.io/s/goofy-swanson-03q1nc?file=/src/App.js
Prerequisites
<button>Click me</button>
await user.pointer({ keys: '[MouseLeft]', target: screen.getByRole('button') })
await user.pointer({ keys: '[MouseRight]', target: screen.getByRole('button') })
await user.pointer({ keys: '[MouseMiddle]', target: screen.getByRole('button') })
Expected behavior
PointerEvent
setsevent.button
andevent.buttons
correctly.https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events#determining_button_states
Actual behavior
Both
event.button
andevent.buttons
are always0
.Note: Changing the event to
mouseDown
gives correct values for the equivalentMouseEvent
.User-event version
14.1.1
Environment
Testing Library framework:
JS framework:
Test environment:
DOM implementation:
Additional context
No response
The text was updated successfully, but these errors were encountered: