Skip to content

fix(form): render select dropdowns for array of enum string items - #518

Open
lukasklier-v-sion wants to merge 1 commit into
nuxt-content:mainfrom
lukasklier-v-sion:feat/AddNativeInputsMapping
Open

fix(form): render select dropdowns for array of enum string items#518
lukasklier-v-sion wants to merge 1 commit into
nuxt-content:mainfrom
lukasklier-v-sion:feat/AddNativeInputsMapping

Conversation

@lukasklier-v-sion

Copy link
Copy Markdown

Summary

Fixes #374

When a collection schema defines z.array(z.enum([...])), the form editor now renders select dropdowns for each array item instead of falling back to free-text inputs.

The enum options were already correctly propagated through schema parsing (buildFormTreeFromSchemaarrayItemForm), but InputArray.vue ignored them when rendering string items.

Changes

  • Detect options on the array item's FormItem (same pattern as InputText.vue)
  • Add a new template section for enum string arrays that renders USelect per item with reorder/delete controls
  • Skip auto-focus on add for enum arrays since the selects are always visible

Before / After

Before: z.array(z.enum([...])) → text inputs (arbitrary strings allowed)
After: z.array(z.enum([...])) → select dropdowns (constrained to enum values)

@vercel

vercel Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

@lukasklier-v-sion is attempting to deploy a commit to the Nuxt Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Native Inputs Mapping for array of enum

1 participant