Skip to content

Commit 7b438de

Browse files
authored
fix(Group): stop click event propagation to prevent selection reset (#65)
Clicking on a Group component triggered its selection logic, but the event propagated to the camera component, which resets all selections on click. This caused the group selection to be immediately cleared. Added event.stopPropagation() to the Group's click listener to prevent the event from reaching the camera and preserve the selection state.
1 parent d524d65 commit 7b438de

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/components/canvas/groups/Group.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ export class Group<T extends TGroup = TGroup> extends GraphComponent<TGroupProps
101101
this.subscribeToGroup();
102102

103103
this.addEventListener("click", (event: MouseEvent) => {
104+
event.stopPropagation();
104105
this.groupState.setSelection(
105106
true,
106107
!isMetaKeyEvent(event) ? ESelectionStrategy.REPLACE : ESelectionStrategy.APPEND

0 commit comments

Comments
 (0)