Skip to content
New issue

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

contextMenu not callable #445

Closed
geoffroymounier opened this issue Sep 8, 2020 · 7 comments · Fixed by #601
Closed

contextMenu not callable #445

geoffroymounier opened this issue Sep 8, 2020 · 7 comments · Fixed by #601
Labels
bug Something isn't working released

Comments

@geoffroymounier
Copy link

Hi!
Any way to make the <div ... onContextMenu={}> fire ?
I've tried by use of userEvent.click(elem, {ctrlKey: true}) userEvent.click(elem, {button: 2}) to emulate the right-click on an element but that does not trigger the context menu.

Any advice on whether this is a enhancement or simply myself doing wrong

So far I'm using fireEvent but I'd love to convert to user-event for all my mocks.

@nickmccurdy
Copy link
Member

nickmccurdy commented Oct 7, 2020

Can reproduce https://codesandbox.io/s/divine-cloud-vrbuz?file=/src/index.test.js

@nickmccurdy nickmccurdy added the bug Something isn't working label Nov 8, 2020
@github-actions
Copy link

🎉 This issue has been resolved in version 13.0.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@ph-fritsche
Copy link
Member

ph-fritsche commented Mar 19, 2021

Thanks for the report 😃

@ph-fritsche
Copy link
Member

@all-contributors add @geoffroymounier bug

@allcontributors
Copy link
Contributor

@ph-fritsche

I've put up a pull request to add @geoffroymounier! 🎉

@metehansenol
Copy link

Seems like this is not possible in v14 anymore. Sad. Any solution?

@sbland
Copy link

sbland commented Mar 24, 2023

For V14 the api has changed. See test here:

test('secondary mouse button fires `contextmenu`', async () => {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants