sanity
sanity copied to clipboard
Allow dynamic `options.list` for String type schema
Is your feature request related to a problem? Please describe.
I want to create dynamic fields based on other fields. I need some behaviour like filter
in references.
There is built-in list
for String
schema which is fine, but I need the list to be dynamic, based on other field.
Describe the solution you'd like Implement
type StaticList = Array<string> | Array<{title: string; value: string}>
type StringOptionsList = StaticList | (docOptions) => StaticList
Describe alternatives you've considered
For my case, filter
behaviour will work, but I don't think it makes too much sense (filter is a query, not a plain js filter)
Additional context
Nothing special
The biggest use case for me is when I'm putting in an address and have country and region fields. The available regions is dependent on which country I pick.
Any updates or creative solutions to this?
Hi!
We are currently working on improving our workflows and follow-up on our open GitHub repository. In that work, we have decided to close most issues older than the release of Sanity Studio v3.
We value your feedback, so if this issue is still important to you and relevant for Sanity Studio v3, please search for relevant open issues. If you can’t find any, open a new one and link to relevant comments in this thread. For questions about how to do something, please post them in the slack community.
I'd end up copy/pasting this issue and recreating it... can we just reopen this issue? I can do that if it's more convenient.