Skip to content

Commit 31acd0c

Browse files
committed
feat: allow opening system context menu with double right click
Signed-off-by: Okku <40242277+0kku@users.noreply.github.com>
1 parent e81ad16 commit 31acd0c

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

packages/client/components/ui/directives/floating.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ export function floating(element: HTMLElement, accessor: Accessor<Props>) {
118118
* Handle context menu click
119119
*/
120120
function onContextMenu(event: MouseEvent) {
121+
// allow opening system context menu by invoking context menu again while context menu is already open
122+
if (show()?.contextMenu) {
123+
setShow(undefined);
124+
return;
125+
}
126+
121127
event.preventDefault();
122128
event.stopPropagation();
123129
event.stopImmediatePropagation();

0 commit comments

Comments
 (0)