ArgType multiple conditions? #18542
Replies: 12 comments 4 replies
-
In reference to this discussion, it seems that it is not currently possible. |
Beta Was this translation helpful? Give feedback.
-
This would be a very useful feature. Any plans of implementing it at some point? |
Beta Was this translation helpful? Give feedback.
-
This syntax only allow "and" or "or" condition. |
Beta Was this translation helpful? Give feedback.
-
Any update on if this will be implemented? |
Beta Was this translation helpful? Give feedback.
-
would be really great if this could be done! |
Beta Was this translation helpful? Give feedback.
-
It seems that if you add the "if" condition twice, it works.
|
Beta Was this translation helpful? Give feedback.
-
The syntax you used for defining multiple conditionals is not correct. When defining multiple conditions, you should use an array of objects where each object represents a conditional statement. Here's an example of how you can define multiple conditionals: errorMessage: { The first object agencia inmobiliaria sitges in the array {arg: "hasError", truthy: true} checks if the hasError control is truthy or not. If it's truthy, the control will be displayed. The second object in the array {arg: "isDisabled", truthy: false, value: "Input is disabled"} checks if the isDisabled control is falsy and also specifies a custom value "Input is disabled" for the errorMessage control. Note that you can add as many objects as you need to the array to define multiple conditionals. |
Beta Was this translation helpful? Give feedback.
-
I created a request for this capability #21281 |
Beta Was this translation helpful? Give feedback.
-
Any updates in this feature being implemented? |
Beta Was this translation helpful? Give feedback.
-
Still nothing new? |
Beta Was this translation helpful? Give feedback.
-
Any news about multiple conditionals? |
Beta Was this translation helpful? Give feedback.
-
This would be very useful, and I’m surprised it’s not possible yet. |
Beta Was this translation helpful? Give feedback.
-
Hello, I checked https://storybook.js.org/docs/react/essentials/controls#conditional-controls for info about conditionals and found I can use something like this:
How can I define multiple conditionals? I tried this but it doesn't work:
It says
Invalid conditional value {}
Beta Was this translation helpful? Give feedback.
All reactions