MCPcopy Create free account
hub / github.com/Comfy-Org/litegraph.js / changeSelection

Method changeSelection

src/LGraphCanvas.ts:6664–6682  ·  view source on GitHub ↗
(forward: boolean)

Source from the content-addressed store, hash-verified

6662 }
6663
6664 function changeSelection(forward: boolean) {
6665 const prev = selected
6666 if (!selected) {
6667 selected = forward
6668 ? helper.childNodes[0]
6669 : helper.childNodes[helper.childNodes.length]
6670 } else if (selected instanceof Element) {
6671 selected.classList.remove("selected")
6672 selected = forward
6673 ? selected.nextSibling
6674 : selected.previousSibling
6675 selected ||= prev
6676 }
6677
6678 if (selected instanceof Element) {
6679 selected.classList.add("selected")
6680 selected.scrollIntoView({ block: "end", behavior: "smooth" })
6681 }
6682 }
6683
6684 function refreshHelper() {
6685 timeout = null

Callers

nothing calls this directly

Calls 2

addMethod · 0.80
removeMethod · 0.45

Tested by

no test coverage detected