From cdbc0fa5e51211d3413aadcdacd30421ec12e7d4 Mon Sep 17 00:00:00 2001 From: filtered <176114999+webfiltered@users.noreply.github.com> Date: Sat, 22 Mar 2025 05:53:13 +1100 Subject: [PATCH] Cancel link connection by pressing Esc (#811) Cancels connecting links if the escape key is pressed. --- src/LGraphCanvas.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/LGraphCanvas.ts b/src/LGraphCanvas.ts index dba93a1e6..efed02908 100644 --- a/src/LGraphCanvas.ts +++ b/src/LGraphCanvas.ts @@ -2917,6 +2917,11 @@ export class LGraphCanvas implements ConnectionColorContext { block_default = true } else if (e.key === "Escape") { // esc + if (this.linkConnector.isConnecting) { + this.linkConnector.reset() + e.preventDefault() + return + } this.node_panel?.close() this.options_panel?.close() block_default = true