Enhancement: Add searchable/combobox UI to choice fields #780

Closed
opened 2026-10-05 03:05:06 +02:00 by adam · 2 comments
Owner

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:

{
  "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.

**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 -->
adam closed this issue 2026-10-05 03:05:06 +02:00
Author
Owner

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.

{
  "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.

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 -->
Author
Owner

It works great in beta 10.12.355353492, thanks!

It works great in beta 10.12.355353492, thanks! <!-- github-comment-id:5802256488 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/vscode-front-matter#780