From 87163c64b502096f8421e217470c8ca0d0c232ef Mon Sep 17 00:00:00 2001 From: antamansid Date: Wed, 29 Apr 2026 11:03:28 +0300 Subject: [PATCH] fix(groups): toggle selection on meta-click --- src/components/canvas/groups/Group.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/components/canvas/groups/Group.ts b/src/components/canvas/groups/Group.ts index 43684c40..d657d365 100644 --- a/src/components/canvas/groups/Group.ts +++ b/src/components/canvas/groups/Group.ts @@ -115,15 +115,18 @@ export class Group extends GraphComponent { - event.stopPropagation(); - this.groupState.setSelection( - true, - !isMetaKeyEvent(event as MouseEvent | KeyboardEvent) ? ESelectionStrategy.REPLACE : ESelectionStrategy.APPEND - ); - }); + this.addEventListener("click", this.handleClick); } + protected handleClick = (event: MouseEvent) => { + event.stopPropagation(); + const isMeta = isMetaKeyEvent(event); + this.groupState.setSelection( + !isMeta ? true : !this.groupState.$selected.value, + !isMeta ? ESelectionStrategy.REPLACE : ESelectionStrategy.APPEND + ); + }; + /** * Set the highlighted state of the group */