mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-22 07:44:11 +00:00
[bugfix] Prevent toolbar remount animation when clicking textarea widgets
When clicking on a textarea DOM widget, it was triggering a selection update even if the node was already selected. This caused the toolbar to unnecessarily re-animate. The fix checks if the node is already selected before calling selectNode, preventing redundant selection updates while maintaining proper selection behavior for unselected nodes. Fixes #4953 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -140,8 +140,13 @@ const setupDOMEventListeners = () => {
|
||||
for (const evt of widget.options.selectOn ?? ['focus', 'click']) {
|
||||
useEventListener(widget.element, evt, () => {
|
||||
const lgCanvas = canvasStore.canvas
|
||||
lgCanvas?.selectNode(widget.node)
|
||||
lgCanvas?.bringToFront(widget.node)
|
||||
if (!lgCanvas) return
|
||||
|
||||
const node = widget.node
|
||||
if (!node.is_selected) {
|
||||
lgCanvas.selectItems([node])
|
||||
}
|
||||
lgCanvas.bringToFront(node)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user