NuxtN
Nuxt8mo ago
20 replies
Ranma

UFormField with UInputMenu errors

When using UInputMenu in a UFormField, I am getting the following errors in Chrome:
- A form field element should have an id or name attribute (UInputMenu input has neither id nor a name attribute)
- Incorrect use of <label for=FORM_ELEMENT> (UFormField label for)

This is the code:
<UFormField label="Country" for="country_code" required>
        <UInputMenu
          id="country_code"
          name="country"
          :items="countries"
          :loading="status === 'pending'"
          label-key="name"
          value-key="code"
          :search-input="{ icon: 'i-lucide-search' }"
          placeholder="Select country"
          class="w-full"
          @update:open="onOpen"
        />
</UFormField>

Have I missed anything here? Any help is appreciated!
Was this page helpful?