\n\u003C/template>\n```\n\nError:\n```\nType '() => Promise\u003Cnumber>' is not assignable to type '((event: FormSubmitEvent\u003Cany>) => any) & ((() => void | Promise\u003Cvoid>) | ((event: FormSubmitEvent\u003Cany>) => void | Promise\u003Cvoid>))'.\n Type '() => Promise\u003Cnumber>' is not assignable to type '((event: FormSubmitEvent\u003Cany>) => any) & (() => void | Promise\u003Cvoid>)'.ts(2322)\nForm.vue.d.ts(59, 18): The expected type comes from property 'onSubmit' which is declared here on type '__VLS_NormalizeComponentEvent\u003CNonNullable\u003C{ onSubmit?: ((event: FormSubmitEvent\u003Cany>) => any) & ((() => void | Promise\u003Cvoid>) | ((event: FormSubmitEvent\u003Cany>) => void | Promise\u003C...>)); ... 11 more ...; class?: any; } & VNodeProps & AllowedComponentProps & ComponentCustomProps>, { ...; }, \"onSubmit\", \"submit\", \"submi...'\n---\n(property) onSubmit?: ((event: FormSubmitEvent\u003Cany>) => any) & ((() => void | Promise\u003Cvoid>) | ((event: FormSubmitEvent\u003Cany>) => void | Promise\u003Cvoid>))\n```\n\n### Description\n\n`\u003CUForm>`s `@submit` event handler type require that it does not return any value. This is needlessly constraining.\n\n### Additional context\n\nThis is not required by the implementation, but instead wholly caused by the types of `onSubmit` property:\nhttps://github.com/nuxt/ui/blob/901bf7cac3ea53264b27adf879ee4072fa9ac242/src/runtime/components/Form.vue#L53\n\nResult of the `onSubmit` prop is not used at all:\nhttps://github.com/nuxt/ui/blob/901bf7cac3ea53264b27adf879ee4072fa9ac242/src/runtime/components/Form.vue#L243\n\nReplacing the type of `onSubmit` with this should be enough:\n```typescript\nexport interface FormProps\u003CS extends FormSchema, T extends boolean = true> {\n // ...\n onSubmit?: (event: FormSubmitEvent\u003CFormData\u003CS, T>>) => unknown\n}\n```\nThis should still allow passing event handlers without arguments.\n\n### Logs\n\n```shell-script\n\n```",[3145,3148],{"name":3146,"color":3147},"bug","d73a4a",{"name":3149,"color":3150},"triage","ffffff",4873,"nuxt","ui","open","`UForm` `onSubmit` type is needlessly constrained","2025-09-02T05:54:14Z","https://github.com/nuxt/ui/issues/4873",0.7185327,{"description":3160,"labels":3161,"number":3166,"owner":3152,"repository":3153,"state":3167,"title":3168,"updated_at":3169,"url":3170,"score":3171},"### Environment\n\n- Operating System: `Windows_NT`\n- Node Version: `v22.18.0`\n- Nuxt Version: `4.1.1`\n- CLI Version: `3.28.0`\n- Nitro Version: `2.12.4`\n- Package Manager: `npm@11.5.2`\n- Builder: `-`\n- User Config: `runtimeConfig`, `modules`, `devtools`, `supabase`, `css`, `routeRules`, `compatibilityDate`\n- Runtime Modules: `@nuxt/ui-pro@3.3.3`, `@vueuse/nuxt@13.9.0`, `@nuxtjs/supabase@1.6.2`, `nuxt-charts@0.2.3`\n- Build Modules: `-`\n\n\n### Is this bug related to Nuxt or Vue?\n\nNuxt\n\n### Package\n\nv3.x\n\n### Version\n\nv3.3.3\n\n### Reproduction\n\nhttps://codesandbox.io/p/devbox/zen-euclid-cf554n\n\n### Description\n\nThe problem occurs because the UFileUpload component likely contains a button element that doesn't have an explicit type attribute, causing it to default to type=\"submit\", which triggers form submission.\n\n### Additional context\n\n```\n\u003Ccomponent\n :is=\"variant === 'button' ? 'button' : 'div'\"\n ref=\"dropzoneRef\"\n :type=\"variant === 'button' ? 'button' : undefined\" // 👈 add this maybe?\n :role=\"variant === 'button' ? undefined : 'button'\"\n :data-dragging=\"isDragging\"\n :class=\"ui.base({ class: props.ui?.base })\"\n :tabindex=\"interactive && !disabled ? 0 : -1\"\n @click=\"interactive && !disabled && open()\" \n @keydown.prevent\n @keyup.enter.space=\"interactive && !disabled && open()\"\n>\n```\n\n### Logs\n\n```shell-script\n\n```",[3162,3163],{"name":3146,"color":3147},{"name":3164,"color":3165},"v3","49DCB8",4935,"closed","UFileUpload with variant button inside form will cause UForm submit","2025-09-09T14:55:29Z","https://github.com/nuxt/ui/issues/4935",0.6994843,{"description":3173,"labels":3174,"number":3183,"owner":3152,"repository":3153,"state":3167,"title":3184,"updated_at":3185,"url":3186,"score":3187},"### For what version of Nuxt UI are you asking this question?\n\nv2.x\n\n### Description\n\nHow can i use [Zod](https://zod.dev/) to validate an [UInput file field](https://ui.nuxt.com/components/input#type)? \n\nLet's say you have the following code:\n(I found the example over [here](https://blog.stackademic.com/upgrade-your-full-stack-form-validation-with-zod-and-react-hook-form-in-next-js-107b014628a3).)\n\n```vue\n\u003CUForm :schema=\"schema\" :state=\"state\" @submit=\"onSubmit\">\n\n \u003CUFormGroup name=\"picture\" label=\"Picture\">\n \u003CUInput v-model=\"state.picture\" type=\"file\" @change=\"onChangeFile\"/>\n \u003C/UFormGroup>\n\n \u003CUButton type=\"submit\">\n Submit\n \u003C/UButton>\n\n\u003C/UForm>\n```\n\n```ts\n\u003Cscript setup lang=\"ts\">\n import { z } from 'zod';\n\n const state = reactive({\n picture: undefined,\n })\n\n const schema = z.object({\n picture: z.custom\u003CFileList>()\n .transform((val) => {\n if (val instanceof File) return val;\n if (val instanceof FileList) return val[0];\n return null;\n })\n .superRefine((file, ctx) => {\n if (!(file instanceof File)) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n fatal: true,\n message: 'Not a file',\n });\n return z.NEVER;\n }\n if (file.size > 5 * 1024 * 1024) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: 'Max file size allowed is 5MB',\n });\n }\n if (\n !['image/jpeg', 'image/png', 'image/webp', 'image/jpg'].includes(\n file.type\n )\n ) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: 'File must be an image (jpeg, jpg, png, webp)',\n });\n }\n })\n });\n\n type Schema = z.infer\u003Ctypeof schema>;\n\n async function onSubmit (event: FormSubmitEvent\u003CSchema>) {\n console.log(event.data);\n }\n\u003C/script>\n```\n\nAs aspected the following onChange function logs a FileList\n\n```ts\nfunction onChangeFile(event: Event) {\n console.log(event)\n}\n```\n\nBut when I log val in the transform function of Zod\n\n```ts\n.transform((val) => {\n console.log(val);\n if (val instanceof File) return val;\n if (val instanceof FileList) return val[0];\n return null;\n})\n```\n\nI get a string like this:\n\n```\nC:\\fakepath\\Screenshot 2024-10-25 at 10.26.36.png\n```\n\nCan someone please help me out, i'm looking for a few days now for a solution.",[3175,3178,3181],{"name":3176,"color":3177},"question","d876e3",{"name":3179,"color":3180},"closed-by-bot","ededed",{"name":3182,"color":3180},"stale",2462,"UInput with type='file', how to validate with Zod?","2025-06-18T09:05:55Z","https://github.com/nuxt/ui/issues/2462",0.7009331,{"description":3189,"labels":3190,"number":3194,"owner":3152,"repository":3153,"state":3167,"title":3195,"updated_at":3196,"url":3197,"score":3198},"### Environment\n\n- Operating System: Windows_NT\n- Node Version: v22.13.1\n- Nuxt Version: 3.17.4\n- CLI Version: 3.25.1\n- Nitro Version: 2.11.12\n- Package Manager: pnpm@10.6.3\n- Builder: -\n- User Config: telemetry, ssr, future, compatibilityDate, modules, hooks, nitro, css, routeRules, devtools, experimental, typescript, imports\n- Runtime Modules: @nuxt/ui-pro@3.1.3, @vueuse/nuxt@13.3.0, @pinia/nuxt@0.11.0, @pinia/colada-nuxt@0.2.0\n- Build Modules: -\n\n### Is this bug related to Nuxt or Vue?\n\nNuxt\n\n### Version\n\n3.1.3\n\n### Reproduction\n\nhttps://codesandbox.io/p/devbox/suspicious-water-smppjv\n\n### Description\n\nThe docs note that you can access exposed variables from `UForm`. I've found that the following fields are not reactive:\n- dirty \n- dirtyFields\n- blurredFields\n- touchedFields\n\n### Additional context\n\nI see in the [source](https://github.com/nuxt/ui/blob/v3/src/runtime/components/Form.vue) that they're not defined with `ref` or `reactive`.\n\nAdditionally, the `dirty` computed that gets exposed would never get updated since `dirtyFields` is not reactive.\n\n### Logs\n\n```shell-script\n\n```",[3191,3192,3193],{"name":3146,"color":3147},{"name":3164,"color":3165},{"name":3149,"color":3150},4238,"Form exposed dirty, dirtyFields, blurredFields, and touchedFields are not reactive","2025-06-24T15:56:14Z","https://github.com/nuxt/ui/issues/4238",0.7056019,{"description":3200,"labels":3201,"number":3204,"owner":3152,"repository":3153,"state":3167,"title":3205,"updated_at":3206,"url":3207,"score":3208},"### Environment\n\n- Operating System: Darwin\n- Node Version: v23.4.0\n- Nuxt Version: 3.16.1\n- CLI Version: 3.23.1\n- Nitro Version: 2.11.7\n- Package Manager: bun@1.2.5\n- Builder: -\n- User Config: devtools, modules, imports, components, css, compatibilityDate, experimental, future\n- Runtime Modules: @nuxt/ui@3.0.0\n- Build Modules: -\n\n### Is this bug related to Nuxt or Vue?\n\nNuxt\n\n### Version\n\nv3.0.0\n\n### Reproduction\n\nhttps://codesandbox.io/p/devbox/recursing-browser-klwx46\n\n### Description\n\nWhen a `SelectMenu` is wrapped in a custom component which is then consumed by `FormField` validation is triggered for an instant before the component goes back to its valid state.\n\nI've tried to debug a bit and I think it's related to the fact that the `SelectMenu` uses `Input` and that input is firing a `change` event because it uses `useFormField`, even though that particular input should not be considered the \"form field\" in this instance.\n\n### Additional context\n\nhttps://github.com/user-attachments/assets/75e8c84f-612e-48f0-bf9e-dcc1fe95ffcd\n\nI'd like to open a PR and fix this myself but I'm not sure what the best approach it. Maybe `Input` could take a prop that allows it to not fire form events? i.e. `ignore-form-events=\"true\"` so the SelectMenu would use it. This could also apply for other components that use primitive form inputs inside them (Command, InputMenu) etc.\n\n### Logs\n\n```shell-script\n\n```",[3202,3203],{"name":3146,"color":3147},{"name":3164,"color":3165},3736,"[USelectMenu] Validation events are triggered before change when wrapped in a custom component","2025-05-14T17:24:48Z","https://github.com/nuxt/ui/issues/3736",0.7093019,{"description":3210,"labels":3211,"number":3214,"owner":3152,"repository":3153,"state":3167,"title":3215,"updated_at":3216,"url":3217,"score":3218},"### For what version of Nuxt UI are you asking this question?\n\nv2.x\n\n### Description\n\nI'm using the FormGroup component, and I've set the error to true, however unless it contains a non-empty text value the error slot won't render. Is this intentional or a bug? I would tend to think it's the latter.\n\n```\n\u003CUFormGroup :error=\"true\">\n \u003Ctemplate #error>\n \u003Cdiv>I will not render\u003C/div>\n \u003Ctemplate>\n\u003C/UFormGroup>\n```\n\n```\n\u003CUFormGroup :error=\"true && 'some error'\">\n \u003Ctemplate #error>\n \u003Cdiv>I will render\u003C/div>\n \u003Ctemplate>\n\u003C/UFormGroup>\n```",[3212,3213],{"name":3146,"color":3147},{"name":3182,"color":3180},2634,"FormGroup error with error slot","2025-06-14T15:36:58Z","https://github.com/nuxt/ui/issues/2634",0.71374714,{"description":3220,"labels":3221,"number":3224,"owner":3152,"repository":3153,"state":3167,"title":3225,"updated_at":3226,"url":3227,"score":3228},"### Description\n\n```\n\u003Cscript setup lang=\"ts\">\nimport * as z from \"zod\";\nimport type { FormSubmitEvent } from \"@nuxt/ui\";\ninterface Props {\n cabinData?: Cabin;\n}\nconst props = defineProps\u003CProps>();\nconst form = useTemplateRef(\"form\");\n\nconst schema = z.object({\n name: z.string().min(1, \"Cabin name is required\"),\n capacity: z.number().min(1, \"Capacity must be at least 1\").optional(),\n price: z.number().min(0, \"Price must be at least 0\").optional(),\n discount: z.number().min(0, \"Discount must be at least 0\").optional(),\n image: z.string().optional(),\n});\n\nconst isDirty: ComputedRef\u003Cboolean | undefined> = computed(() => {\n return form.value?.dirty;\n});\n\ntype Schema = z.output\u003Ctypeof schema>;\nconst state = reactive\u003CPartial\u003CSchema>>({\n name: props.cabinData?.name || \"\",\n capacity: props.cabinData?.capacity || undefined,\n price: props.cabinData?.price || undefined,\n discount: props.cabinData?.discount || undefined,\n image: undefined,\n});\nasync function onSubmit(event: FormSubmitEvent\u003CSchema>) {}\n\u003C/script>\n\n\u003Ctemplate>\n \u003CUForm\n ref=\"form\"\n :schema=\"schema\"\n :state=\"state\"\n class=\"w-full space-y-8\"\n @submit=\"onSubmit\"\n >\n \u003Cdiv class=\"border-b-grey-200 flex gap-12 border-b py-4\">\n \u003Clabel for=\"name\" class=\"w-1/5 font-semibold\">Name\u003C/label>\n \u003CUFormField name=\"name\">\n \u003CUInput\n id=\"name\"\n v-model=\"state.name\"\n color=\"info\"\n :ui=\"{\n base: ' disabled:bg-grey-50/10',\n }\"\n />\n \u003C/UFormField>\n \u003C/div>\n\n \u003Cdiv class=\"border-b-grey-200 flex gap-12 border-b py-4\">\n \u003Clabel for=\"capacity\" class=\"w-1/5 font-semibold\">Capacity\u003C/label>\n \u003CUFormField name=\"capacity\">\n \u003CUInputNumber\n id=\"capacity\"\n v-model=\"state.capacity\"\n color=\"info\"\n :ui=\"{\n base: ' disabled:bg-grey-50/10',\n }\"\n />\n \u003C/UFormField>\n \u003C/div>\n\n \u003Cdiv class=\"border-b-grey-200 flex gap-12 border-b py-4\">\n \u003Clabel for=\"price\" class=\"w-1/5 font-semibold\">Price\u003C/label>\n \u003CUFormField name=\"price\">\n \u003CUInputNumber\n id=\"price\"\n v-model=\"state.price\"\n color=\"info\"\n :ui=\"{\n base: ' disabled:bg-grey-50/10',\n }\"\n />\n \u003C/UFormField>\n \u003C/div>\n\n \u003Cdiv class=\"border-b-grey-200 flex gap-12 border-b py-4\">\n \u003Clabel for=\"discount\" class=\"w-1/5 font-semibold\">Discount\u003C/label>\n \u003CUFormField name=\"discount\">\n \u003CUInputNumber\n id=\"discount\"\n v-model=\"state.discount\"\n color=\"info\"\n :ui=\"{\n base: ' disabled:bg-grey-50/10',\n }\"\n />\n \u003C/UFormField>\n \u003C/div>\n\n \u003Cdiv class=\"flex justify-end pt-4\">\n \u003CUTooltip arrow text=\"Data has not been changed\">\n \u003CUButton\n type=\"submit\"\n class=\"bg-brand-600 text-brand-50 hover:bg-brand-700 px-4 py-2 uppercase hover:cursor-pointer\"\n size=\"lg\"\n :disabled=\"!isDirty\"\n >\n Update Data\n \u003C/UButton>\n \u003C/UTooltip>\n\n \u003CUButton\n class=\"bg-grey-200 text-grey-900 hover:bg-grey-50 ml-2 px-4 py-2 uppercase hover:cursor-pointer\"\n size=\"lg\"\n @click=\"\n state.name = '';\n state.capacity = undefined;\n state.price = undefined;\n state.discount = undefined;\n state.image = undefined;\n form?.clear();\n \"\n >\n Cancel\n \u003C/UButton>\n \u003C/div>\n \u003C/UForm>\n\u003C/template>\n\n```\n\n> this is my code i want disable button depending on if fields is dirty or not i'm using computed now but i used ref alswo watchEffect and watch with getter to watch if is there any changes in fields,but depending on documentation dirty is ref boolean but it doesn't change what am i doing wrong ?",[3222,3223],{"name":3176,"color":3177},{"name":3164,"color":3165},4402,"UForm dirty isn't reactive ?","2025-06-26T13:33:41Z","https://github.com/nuxt/ui/issues/4402",0.71448714,{"description":3230,"labels":3231,"number":3235,"owner":3152,"repository":3153,"state":3167,"title":3236,"updated_at":3237,"url":3238,"score":3239},"### Environment\n\nN/A\n\n### Is this bug related to Nuxt or Vue?\n\nNuxt\n\n### Version\n\nv3.2.0\n\n### Reproduction\n\nhttps://codesandbox.io/p/devbox/compassionate-jasper-w2k3lm\n\n### Description\n\nThe `InputMenu` component throws an error if one of the fields provided in `filterFields` resolved to a nullish or non-string value. You can reproduce this in the sandbox by typing in the input box and observing the console.\n\nSo having the following setup errors out, which is a real-world use case I'm encountering this:\n\n```vue\n\u003Cscript lang=\"ts\" setup>\nconst items = [\n {\n label: 'foo',\n alias: 'something'\n },\n {\n label: 'bar'\n }\n]\n\u003C/script>\n\n\u003Ctemplate>\n \u003CUInputMenu :items :filter-fields=\"['label', 'alias']\" />\n\u003C/template>\n```\n\nThis is caused by `useFilter.contains` being called with a non-string value.\n\nIt is somewhat related to https://github.com/nuxt/ui/issues/3606 which has been addressed previously, but only for primitive item types.\n\n### Additional context\n\n_No response_\n\n### Logs\n\n```shell-script\n\n```",[3232,3233,3234],{"name":3146,"color":3147},{"name":3164,"color":3165},{"name":3149,"color":3150},4509,"InputMenu: error if field field is nullish or non-string","2025-07-12T10:15:32Z","https://github.com/nuxt/ui/issues/4509",0.71800727,{"description":3241,"labels":3242,"number":3246,"owner":3152,"repository":3153,"state":3167,"title":3247,"updated_at":3248,"url":3249,"score":3250},"### Environment\n\n- Operating System: Linux\n- Node Version: v22.11.0\n- Nuxt Version: 4.0.3\n- CLI Version: 3.27.0\n- Nitro Version: 2.12.4\n- Package Manager: pnpm@10.14.0\n- Builder: -\n- User Config: modules, $production, components, devtools, app, css, site, mdc, ui, compatibilityDate, nitro, vite, eslint, fonts, icon, linkChecker, ogImage, seo, sitemap\n- Runtime Modules: @nuxtjs/seo@3.1.0, @vueuse/nuxt@13.7.0, @nuxt/ui@3.3.2, @nuxt/eslint@1.9.0, @nuxt/scripts@0.11.10, motion-v/nuxt@1.7.0, @nuxtjs/mdc@0.17.2\n- Build Modules: -\n\n### Is this bug related to Nuxt or Vue?\n\nNuxt\n\n### Package\n\nv3.x\n\n### Version\n\nv3.3.2\n\n### Reproduction\n\n```vue\n\u003Cscript setup lang=\"ts\">\n// This causes TypeScript error\nconst handleFileChange = (file: File | File[] | null) => {\n console.log(file);\n};\n\u003C/script>\n\n\u003Ctemplate>\n \u003CUFileUpload @update:model-value=\"handleFileChange\" />\n\u003C/template>\n```\n\n### Description\n\nThe `@update:model-value` event handler for `UFileUpload` component emits `unknown` type instead of the documented type `File | File[] | null | undefined`.\n\n**Expected Behavior (per documentation)**\nAccording to the [official documentation](https://ui.nuxt.com/components/file-upload#emits), the `@update:model-value` event should emit:\n- `[value: File | File[] | null | undefined]`\n\n### Additional context\n\n_No response_\n\n### Logs\n\n```shell-script\n\n```",[3243,3244,3245],{"name":3146,"color":3147},{"name":3164,"color":3165},{"name":3149,"color":3150},4852,"Type mismatch: UFileUpload @update:model-value emits unknown instead of documented type","2025-09-01T10:56:13Z","https://github.com/nuxt/ui/issues/4852",0.7187151,{"description":3252,"labels":3253,"number":3257,"owner":3152,"repository":3153,"state":3167,"title":3258,"updated_at":3259,"url":3260,"score":3261},"### Environment\n\nOperating System: mac os\nNode Version: v22.14.0\nLaravel Version: 12.12.0\nNitro Version: -\nPackage Manager: bun 1.2.11\nBuilder: -\nUser Config: -\nRuntime Modules: -\nBuild Modules: -\n\n### Is this bug related to Nuxt or Vue?\n\nVue\n\n### Version\n\nv3.1.1\n\n### Reproduction\n\nN/A\n\n### Description\n\nI'm using the example from the documentation for implementing a login and the button behaves like a link. I've already tried as=\"button\" and it doesn't work.\n\n```\n\u003Cscript setup lang=\"ts\">\nimport * as z from 'zod'\nimport type { FormSubmitEvent } from '@nuxt/ui'\n\nconst schema = z.object({\n email: z.string().email('Invalid email'),\n password: z.string().min(8, 'Must be at least 8 characters')\n})\n\ntype Schema = z.output\u003Ctypeof schema>\n\nconst state = reactive\u003CPartial\u003CSchema>>({\n email: undefined,\n password: undefined\n})\n\nconst toast = useToast()\nasync function onSubmit(event: FormSubmitEvent\u003CSchema>) {\n toast.add({ title: 'Success', description: 'The form has been submitted.', color: 'success' })\n console.log(event.data)\n}\n\u003C/script>\n\u003Ctemplate>\n \u003CUForm :schema=\"schema\" :state=\"state\" class=\"space-y-4\" @submit=\"onSubmit\">\n \u003CUFormField label=\"Email\" name=\"email\">\n \u003CUInput v-model=\"state.email\" />\n \u003C/UFormField>\n \u003CUFormField label=\"Password\" name=\"password\">\n \u003CUInput v-model=\"state.password\" type=\"password\" />\n \u003C/UFormField>\n \u003CUButton type=\"submit\">\n Submit\n \u003C/UButton>\n \u003C/UForm>\n\u003C/template>\n```\n\n### Additional context\n\n\n\n### Logs\n\n```shell-script\n\n```",[3254,3255,3256],{"name":3146,"color":3147},{"name":3164,"color":3165},{"name":3149,"color":3150},4095,"UButton works as a link in Inertia","2025-05-07T08:12:17Z","https://github.com/nuxt/ui/issues/4095",0.7194883,["Reactive",3263],{},["Set"],["ShallowReactive",3266],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fYFu9h1OI4xaVxXCT8EvDThy1z_WekJmT-O_NTPC7zw8":-1},"/nuxt/ui/4637"]