Custom node's input port disappears if the "inputs" field's value is greater than 1

Environment

Node-RED 2.0.5

Repro

For my custom node, I allow two input ports, so in node.html, I filled the number of inputs this way

inputs: 2,
outputs: 2,

Expectation

Knowing that NR supports a single in-port, I expect to see just one in-port at the left end of my node.

Observation

  • However, the node in the workspace looks like there are no in-ports at all.
  • There appear to be two out-ports as expected

Question

This behavior feels a bit counterintuitive. Is this by design? Should I remember to keep the "inputs" field as either 1 or 0 at all times?

Node-RED doesn't support more than 1 input. The code assumes the value is 0 or 1. I don't think I've ever tested the behaviour of setting it to anything else, because it isn't supported.

1 Like

@knolleary Thanks for clarifying, Nick.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.