From 16847e18d606bb9ed9f2016e586cf4b4348b132e Mon Sep 17 00:00:00 2001 From: Philipp Fritsche Date: Fri, 19 Mar 2021 18:49:36 +0100 Subject: [PATCH] fix(click): right click triggers contextmenu (#601) --- src/__tests__/click.js | 14 ++++++++++++++ src/click.ts | 14 +++++++++++--- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/__tests__/click.js b/src/__tests__/click.js index 8a0e784e..bdbf2bf2 100644 --- a/src/__tests__/click.js +++ b/src/__tests__/click.js @@ -459,3 +459,17 @@ test('move focus to closest focusable element', () => { userEvent.click(element.children[0]) expect(element).toHaveFocus() }) + +test('right click fires `contextmenu` instead of `click', () => { + const {element, getEvents, clearEventCalls} = setup(`