Is your feature request related to a problem? Please describe.
I originally used a taxonomy field because I liked its searchable/combobox UI and support for multiple selections.
However, I needed each option to have a custom label different from the value stored in front matter. Since choice supports the id / title structure, I switched to it.
The problem is that choice does not provide the same searchable/filterable UI as taxonomy. This becomes cumbersome when there are many choices.
Describe the solution you'd like
I would like choice fields to optionally use a searchable/combobox UI, similar to the one provided by taxonomy.
Ideally, this would keep the existing id / title and multiple capabilities:
This would make choice a good fit for predefined, domain-specific values that are not taxonomies, while still providing a convenient UI for large lists.
Describe alternatives you've considered
Using taxonomy works well from a UI perspective, but does not fit my use case because I need a label that can differ from the stored value.
I also considered whether a custom field could be used, but this feels like it could be unnecessarily complex when choice already provides the required data model.
Additional context
It seems that the existing choice field already has most of the required functionality (id / title and multiple selection). The main missing piece is the searchable/combobox UI.
**Is your feature request related to a problem? Please describe.**
I originally used a `taxonomy` field because I liked its searchable/combobox UI and support for multiple selections.
However, I needed each option to have a custom label different from the value stored in front matter. Since `choice` supports the `id` / `title` structure, I switched to it.
The problem is that `choice` does not provide the same searchable/filterable UI as `taxonomy`. This becomes cumbersome when there are many choices.
**Describe the solution you'd like**
I would like `choice` fields to optionally use a searchable/combobox UI, similar to the one provided by `taxonomy`.
Ideally, this would keep the existing `id` / `title` and `multiple` capabilities:
```json
{
"type": "choice",
"multiple": true,
"choices": [
{ "id": "some-value", "title": "A custom label" },
{ "id": "another-value", "title": "Another custom label" }
]
}
```
This would make `choice` a good fit for predefined, domain-specific values that are not taxonomies, while still providing a convenient UI for large lists.
**Describe alternatives you've considered**
Using `taxonomy` works well from a UI perspective, but does not fit my use case because I need a label that can differ from the stored value.
I also considered whether a custom field could be used, but this feels like it could be unnecessarily complex when `choice` already provides the required data model.
**Additional context**
It seems that the existing `choice` field already has most of the required functionality (`id` / `title` and multiple selection). The main missing piece is the searchable/combobox UI.
<!-- github-sync-id:5504500300 -->
Thanks for the suggestion @postb99! I added a searchable property which you can set on choice fields. When enabled, the dropdown is replaced by a searchable input, like the one from the taxonomy field. The id / title structure and multiple keep working as before.
Filtering is case-insensitive and matches on both the title and the id of the choice.
Selected values are still shown as buttons underneath the field, so you can remove them the same way as today.
This will be available for testing in the next BETA release.
Thanks for the suggestion @postb99! I added a `searchable` property which you can set on `choice` fields. When enabled, the dropdown is replaced by a searchable input, like the one from the `taxonomy` field. The `id` / `title` structure and `multiple` keep working as before.
```json
{
"title": "Category",
"name": "category",
"type": "choice",
"multiple": true,
"searchable": true,
"choices": [
{ "id": "some-value", "title": "A custom label" },
{ "id": "another-value", "title": "Another custom label" }
]
}
```
A couple of details:
- Filtering is case-insensitive and matches on both the `title` and the `id` of the choice.
- Selected values are still shown as buttons underneath the field, so you can remove them the same way as today.
This will be available for testing in the next BETA release.
<!-- github-comment-id:5752245243 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Is your feature request related to a problem? Please describe.
I originally used a
taxonomyfield because I liked its searchable/combobox UI and support for multiple selections.However, I needed each option to have a custom label different from the value stored in front matter. Since
choicesupports theid/titlestructure, I switched to it.The problem is that
choicedoes not provide the same searchable/filterable UI astaxonomy. This becomes cumbersome when there are many choices.Describe the solution you'd like
I would like
choicefields to optionally use a searchable/combobox UI, similar to the one provided bytaxonomy.Ideally, this would keep the existing
id/titleandmultiplecapabilities:This would make
choicea good fit for predefined, domain-specific values that are not taxonomies, while still providing a convenient UI for large lists.Describe alternatives you've considered
Using
taxonomyworks well from a UI perspective, but does not fit my use case because I need a label that can differ from the stored value.I also considered whether a custom field could be used, but this feels like it could be unnecessarily complex when
choicealready provides the required data model.Additional context
It seems that the existing
choicefield already has most of the required functionality (id/titleand multiple selection). The main missing piece is the searchable/combobox UI.Thanks for the suggestion @postb99! I added a
searchableproperty which you can set onchoicefields. When enabled, the dropdown is replaced by a searchable input, like the one from thetaxonomyfield. Theid/titlestructure andmultiplekeep working as before.A couple of details:
titleand theidof the choice.This will be available for testing in the next BETA release.
It works great in beta 10.12.355353492, thanks!