From b25c5259bd1caf58fc99161974be65b02bc10e90 Mon Sep 17 00:00:00 2001 From: Chenlei Hu Date: Wed, 28 Aug 2024 16:35:01 -0400 Subject: [PATCH] Fix node title editor's width when node is collapsed (#671) * Fix node title editor's width when node is collapsed * nit --- src/components/graph/NodeTitleEditor.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/graph/NodeTitleEditor.vue b/src/components/graph/NodeTitleEditor.vue index 322abac2c..d369addc6 100644 --- a/src/components/graph/NodeTitleEditor.vue +++ b/src/components/graph/NodeTitleEditor.vue @@ -54,9 +54,12 @@ const extension: ComfyExtension = { editedTitle.value = this.title showInput.value = true + const isCollapsed = node.flags?.collapsed const [x1, y1, x2, y2] = this.getBounding() const [nodeWidth, nodeHeight] = this.size - const canvasWidth = nodeWidth + const canvasWidth = + // @ts-expect-error Remove after collapsed_width is exposed in LiteGraph + isCollapsed && node._collapsed_width ? node._collapsed_width : nodeWidth const canvasHeight = LiteGraph.NODE_TITLE_HEIGHT const [left, top] = app.canvasPosToClientPos([x1, y1])