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
Is your feature request related to a problem? Please describe
In the course of my current client project, we stumbled across #19130 while trying to use the conditional controls feature to reproduce our TypeScript interfaces in the controls table.
We quickly found that the simple conditions will become cumbersome or even ineffectual in complex situations.
Describe the solution you'd like
Adding more operators will probably yield little value for most cases, so it would be nice to be able to provide a function that just receives the current controls data as input and returns a boolean.
That way, the current arg+operator would be a shorthand for the most common cases, but cases such as dependency on multiple other props would be doable in the context where the problem space is best known.
Describe alternatives you've considered
Not using the feature was our goto so far 🤷♂️ but we'd like to use it as much as possible.
Are you able to assist to bring the feature to reality?
I can probably code the whole thing, but I wouldn't know where to start and Storybook's source looks so hairy that I'd be afraid to break everything without some pointers.
The text was updated successfully, but these errors were encountered:
This would be a very useful addition, and would help with a lot of the other limitations that currently exist with conditional controls. Such as the inability to set multiple conditional controls or conditional controls that check against multiple values (related -- #21281).
Being able to define a function that returns a boolean would open this up to let developers handle more complex situations.
Is your feature request related to a problem? Please describe
In the course of my current client project, we stumbled across #19130 while trying to use the conditional controls feature to reproduce our TypeScript interfaces in the controls table.
We quickly found that the simple conditions will become cumbersome or even ineffectual in complex situations.
Describe the solution you'd like
Adding more operators will probably yield little value for most cases, so it would be nice to be able to provide a function that just receives the current controls data as input and returns a boolean.
That way, the current arg+operator would be a shorthand for the most common cases, but cases such as dependency on multiple other props would be doable in the context where the problem space is best known.
Describe alternatives you've considered
Not using the feature was our goto so far 🤷♂️ but we'd like to use it as much as possible.
Are you able to assist to bring the feature to reality?
I can probably code the whole thing, but I wouldn't know where to start and Storybook's source looks so hairy that I'd be afraid to break everything without some pointers.
The text was updated successfully, but these errors were encountered: