Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UForm does not show error for multiple paths #2981

Closed
cybercoder-naj opened this issue Dec 26, 2024 · 1 comment
Closed

UForm does not show error for multiple paths #2981

cybercoder-naj opened this issue Dec 26, 2024 · 1 comment
Labels
bug Something isn't working triage

Comments

@cybercoder-naj
Copy link

cybercoder-naj commented Dec 26, 2024

Environment


  • Operating System: Linux
  • Node Version: v22.8.0
  • Nuxt Version: 3.14.1592
  • CLI Version: 3.17.1
  • Nitro Version: 2.10.4
  • Package Manager: bun@1.1.38
  • Builder: -
  • User Config: default
  • Runtime Modules: -
  • Build Modules: -

Version

^2.19.2

Reproduction

https://stackblitz.com/edit/nuxt-ui-umrnyur4?file=app.vue

Description

I am using Zod for the validation. In the minimal reproduction, since I provided two paths for the error, the message should appear on both fields. However, the error message only shows if only 1 path is specified.

Additional context

Logs

@romhml
Copy link
Collaborator

romhml commented Jan 2, 2025

The current behaviour is expected, the dot separator is used to identify nested validation rules, in arrays or objects for example. The PR you submitted would break these use cases if merged. I'd recommend using .superRefine to return two errors in your case.

@romhml romhml closed this as completed Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

2 participants