From b74662fbadca421be08babc054130a0d380ef86c Mon Sep 17 00:00:00 2001 From: filtered <176114999+webfiltered@users.noreply.github.com> Date: Thu, 31 Oct 2024 10:48:48 +1100 Subject: [PATCH] Fix group order unexpectedly reversing (#242) --- src/LGraph.ts | 4 ++-- tsconfig.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/LGraph.ts b/src/LGraph.ts index 2eeaddb39..018424600 100644 --- a/src/LGraph.ts +++ b/src/LGraph.ts @@ -848,8 +848,8 @@ export class LGraph { * @param y The y coordinate in canvas space * @return The group or null */ - getGroupOnPos(x: number, y: number, { margin = 2 } = {}) { - return this._groups.reverse().find(g => g.isPointInside(x, y, margin, /* skip_title */ true)) + getGroupOnPos(x: number, y: number, { margin = 2 } = {}): LGraphGroup | undefined { + return this._groups.toReversed().find(g => g.isPointInside(x, y, margin, true)) } /** diff --git a/tsconfig.json b/tsconfig.json index 4bd301b12..1ab9fa8c9 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,7 +3,7 @@ "target": "ES2022", "useDefineForClassFields": true, "module": "ESNext", - "lib": ["ES2022", "DOM", "DOM.Iterable"], + "lib": ["ES2023", "DOM", "DOM.Iterable"], "skipLibCheck": true, "sourceMap": true, "esModuleInterop": true,