You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying a logical AND node type that dynamically renders the inputs so that it always creates an extra input after the last connected input:
.addNodeType({
type: "and",
label: "And Boolean Test",
description: "Performs a logical AND operation on the input boolean values",
initialWidth: 140,
inputs: ports => (inputData, connections) => {
// Determine the number of current connections
const connectedInputs = Object.keys(connections.inputs).length;
// Create an array of boolean inputs, adding one extra unconnected input
const inputPorts = [];
for (let i = 0; i < connectedInputs; i++) {
console.log(`input_${i + 1}`);
inputPorts.push(
ports.boolean({ name: `input_${i + 1}`, label: `Input ${i + 1}` })
);
}
return inputPorts;
},
outputs: ports => [
ports.boolean()
]
})
This works as expected, the only issue is that when I render the nodes to JSON it doesn't seem to name the first input input_1 as expected (instead it's named boolean):
I'm trying a logical AND node type that dynamically renders the inputs so that it always creates an extra input after the last connected input:
This works as expected, the only issue is that when I render the nodes to JSON it doesn't seem to name the first input
input_1
as expected (instead it's namedboolean
):The text was updated successfully, but these errors were encountered: