From 808d78169b42ea1850417ba47779e93ecc2f0fb4 Mon Sep 17 00:00:00 2001 From: Chenlei Hu Date: Tue, 25 Mar 2025 10:22:40 -0400 Subject: [PATCH] Early return in LGraphCanvas.deselectAll (#856) Avoid trigger `onSelectionChange` when nothing is selected. --- src/LGraphCanvas.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/LGraphCanvas.ts b/src/LGraphCanvas.ts index 6614236cf..93e731461 100644 --- a/src/LGraphCanvas.ts +++ b/src/LGraphCanvas.ts @@ -3436,6 +3436,8 @@ export class LGraphCanvas implements ConnectionColorContext { if (!this.graph) return const selected = this.selectedItems + if (!selected.size) return + let wasSelected: Positionable | undefined for (const sel of selected) { if (sel === keepSelected) {