Skip to content

Simulate MacOS X' Ctrl + Click as a contextmenu #924

Open
@julienw

Description

@julienw

Problem description

On MacOS X, it's possible to trigger a contextmenu event with ctrl + click. This gives a contextmenu event with { button: 0, buttons: 1 } (as opposed to { button: 2, buttons: 2 } for a normal right click). It would be good to be able to trigger this somehow, and I haven't found that the user-event library can do it at the moment.

Suggested solution

This would be my prefered solution:

const user = userEvent.setup({ environment: 'macosx' });
await user.keyboard("{Shift>}");
await user.click(target);

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestneeds specificationThe desired behavior is not defined yet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions