flume icon indicating copy to clipboard operation
flume copied to clipboard

Allow setting a flag which works like !noControls (alwaysShowControls)

Open andraz-at opened this issue 4 years ago • 2 comments

I want to create a custom control to display custom data inline with the input (example is a boolean "lamp" changing color if incoming input is true or false). An inline input indicator.

My problem is that connecting the input port triggers state similar to noControls flag, which hides the controls (including my custom control which I use to display state).

Ports named Indicator 2 and 3 have an input connected which causes them to lose the custom controls.

image

The third node is an experimental solution using separate node with custom (standalone externally controlled) control but this is a fragile complex workaround, you need to manually manage all custom controls.

p.s.: Alternative way of solving this would be to allow to define an JSX "indicator" component, which overrides the "label" of the port and gets displayed all the time, no matter if controls are enabled or not. This would also be more semantically correct, as using a custom port control for the indicator is actually a hack.

andraz-at avatar Aug 19 '20 16:08 andraz-at

This also came up in issue #29. Implementing a way to keep controls rendered when they're connected wouldn't be that hard to do I think. I'd like to hear more about your use-case here though. I'm not totally clear on how your third node here is intended to work.

chrisjpatty avatar Aug 24 '20 20:08 chrisjpatty

The third node works like the demonstration "login/signup" example - it is an external UI component. It is controlled by the second node inputs.

I've added a custom input port (with hidden connector) to the third node to render the external component directly into the editor's UI. Third node is just a graphical example of the look which I wish to achieve by configuring the second node.

At the moment indicator#2 and indicator#3 custom styling disappears.

andraz-at avatar Aug 25 '20 07:08 andraz-at