Conditionally revealing inputs based on another input in a Framework Doc #1673
-
Good morning, Apologies if this is a very simple question, but I'm curious if it's possible to conditionally show inputs to the user based on the value of another input? I've had a look through the documentation but can't quite find anything that does the job. For example, let's say I have const category = view(Inputs.select(["A", "B", "C"]))
const value = view(Inputs.range([1,100])) If I only want the range Input I know I could disable it, or set it to only take one value, but I worry that will end up looking messy if there are multiple "branches" of options. What I'm after is effectively an analogue to Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Sure. You could name the input and display it conditionally: ```js
const category = view(Inputs.select(["A", "B", "C"]))
const valueInput = Inputs.range([1,100])
const value = Generators.input(valueInput);
```
${category === "A" ? valueInput : ""}
|
Beta Was this translation helpful? Give feedback.
Sure. You could name the input and display it conditionally: