When toggling selected, align state (#5482)

Previously, when toggling the mode of multiple nodes, each node would
have its state individually toggled. Now it enables mode if any node is
not currently set to that mode and only disables if all already match.
This commit is contained in:
AustinMroz
2025-09-11 00:50:26 -07:00
committed by GitHub
parent 6ea021d595
commit 568be0c44c
2 changed files with 6 additions and 4 deletions

View File

@@ -237,9 +237,9 @@ describe('useSelectedLiteGraphItems', () => {
toggleSelectedNodesMode(LGraphEventMode.NEVER)
// node1 should change from ALWAYS to NEVER
// node2 should change from NEVER to ALWAYS (since it was already NEVER)
// node2 should stay NEVER (since a selected node exists which is not NEVER)
expect(node1.mode).toBe(LGraphEventMode.NEVER)
expect(node2.mode).toBe(LGraphEventMode.ALWAYS)
expect(node2.mode).toBe(LGraphEventMode.NEVER)
})
it('toggleSelectedNodesMode should set mode to ALWAYS when already in target mode', () => {