diff options
| author | bobzel <zzzman@gmail.com> | 2021-09-14 19:13:34 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2021-09-14 19:13:34 -0400 |
| commit | 7ab2011d3b6bb7bb2e945265d4ff97983a5a1f38 (patch) | |
| tree | 628972792123069b9272e9483e76926d725c2561 /src/Utils.ts | |
| parent | f4b3781cf2250477482d8260e7137d9cbdfcb8e4 (diff) | |
fixed right-click context menu for Windows.
Diffstat (limited to 'src/Utils.ts')
| -rw-r--r-- | src/Utils.ts | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/src/Utils.ts b/src/Utils.ts index ddc16dceb..6eacd8296 100644 --- a/src/Utils.ts +++ b/src/Utils.ts @@ -552,19 +552,23 @@ export function simulateMouseClick(element: Element | null | undefined, x: numbe screenY: sy, }))); - rightClick && element.dispatchEvent( - new MouseEvent("contextmenu", { - view: window, - bubbles: true, - cancelable: true, - button: 2, - clientX: x, - clientY: y, - movementX: 0, - movementY: 0, - screenX: sx, - screenY: sy, - })); + if (rightClick) { + const me = + new MouseEvent("contextmenu", { + view: window, + bubbles: true, + cancelable: true, + button: 2, + clientX: x, + clientY: y, + movementX: 0, + movementY: 0, + screenX: sx, + screenY: sy, + }); + (me as any).dash = true; + element.dispatchEvent(me); + } } export function lightOrDark(color: any) { |
