sanity icon indicating copy to clipboard operation
sanity copied to clipboard

Allow dynamic `options.list` for String type schema

Open lkostrowski opened this issue 3 years ago • 2 comments

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

lkostrowski avatar Oct 03 '21 18:10 lkostrowski

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.

saiichihashimoto avatar Apr 20 '22 21:04 saiichihashimoto

Any updates or creative solutions to this?

troymcginnis avatar Jul 12 '22 15:07 troymcginnis

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.

kmelve avatar Jan 11 '23 20:01 kmelve

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.

saiichihashimoto avatar Jan 11 '23 22:01 saiichihashimoto