fix: set widget.hidden in toggleWidget_2 to prevent textarea overlap in modern frontend - #385
fix: set widget.hidden in toggleWidget_2 to prevent textarea overlap in modern frontend#385DDavisWA wants to merge 2 commits into
Conversation
…in modern ComfyUI frontend ComfyUI frontend >= v1.43.18 renders multiline STRING widgets (CLIP_POSITIVE / CLIP_NEGATIVE in the Efficient Loader) as DOM elements whose Y-position is calculated by accumulating the heights of all preceding widgets. The frontend uses widget.hidden to skip excluded widgets in this accumulation. toggleWidget_2 (used for Efficient Loader) was hiding lora_model_strength and lora_clip_strength by setting widget.type and widget.computeSize only, without setting widget.hidden. Those widgets still contributed to the Y-offset accumulation, pushing the CLIP text boxes down into the fields below them. Fix mirrors the existing pattern in toggleWidget: add widget.hidden = !show.
85abb28 to
7f9f6b5
Compare
Update fix-xyinput-stray-widget with a bugfix that the display state is not connected to the side panel.
Comment on PR #384 #385I tested #384 and #385 together on ComfyUI frontend v1.43.18 and found one remaining Node Details case. Reproduction workflow and evidencewidgethider-check.json
The workflow is intended for UI verification; it does not need to be queued. After 1 (after applying #384 #385): Remaining issue#384 and #385 correctly update However, when the right-side Node Details / Parameters panel is already open, changing a mode or count that reveals additional Efficiency Nodes widgets can leave the newly visible parameter rows overflowing or misaligned. After 2 (after applying #384 #385, triggering error): Root causeThe frontend has two visibility consumers:
In this PR, the relevant code is the ComfyUI frontend's own Proposed follow-upPlease add this immediately after if (widget.options) widget.options.hidden = !show;I will open a focused stacked PR at Last (after applying #384 #385 and my patches): Basic Stability Testdefault-step-cfg-XY.json |
Includes hwyao's follow-up syncing widget.options.hidden in toggleWidget_2.




Problem
In ComfyUI frontend >= v1.43.18, multiline STRING widgets (CLIP_POSITIVE / CLIP_NEGATIVE in the Efficient Loader) are rendered as DOM elements whose Y-position is calculated by accumulating the heights of all preceding widgets. The frontend uses
widget.hiddento skip excluded widgets in this accumulation.toggleWidget_2(used for the Efficient Loader) was hidinglora_model_strengthandlora_clip_strengthby settingwidget.typeandwidget.computeSizeonly — without settingwidget.hidden. Those widgets still contributed to the Y-offset accumulation, pushing the CLIP text boxes down into the fields below them (token_normalization,weight_interpretation, etc.).Fix
One line added to
toggleWidget_2, mirroring the pattern already present intoggleWidget:Testing
Open an Efficient Loader node with
lora_name = None. CLIP_POSITIVE and CLIP_NEGATIVE text boxes sit in their correct positions and no longer overlap the fields below them.Related
Part of the fix for #344 (efficiency-nodes UI trouble). This PR covers
toggleWidget_2(Efficient Loader text boxes); #384 covers the same class of bug intoggleWidget(XY Input / quantity-adjust nodes). The two together resolve the widget-overlap issues reported in #344.