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

[1.x] Display validation errors alongside their field #175

Merged
merged 2 commits into from
Aug 3, 2022

Conversation

jessarcher
Copy link
Member

@jessarcher jessarcher commented Aug 2, 2022

This PR updates Breeze to display validation errors beneath their respective fields, instead of all grouped together at the top of the page.

The Vue stubs already contained the InputError component for this, but it was not being used. The React stubs were missing the component so I have added it in.

Before
image

After
image

@jessarcher jessarcher marked this pull request as draft August 2, 2022 04:03
@jessarcher jessarcher changed the title [1.x] Add missing InputError component for React [1.x] Display validation errors alongside their field Aug 2, 2022
@jessarcher jessarcher marked this pull request as ready for review August 2, 2022 04:50
@siarheipashkevich
Copy link

Hi @jessarcher

Laravel returns the array of the errors per one field. Is it handled?

Thanks

@taylorotwell taylorotwell marked this pull request as draft August 2, 2022 14:13
@jessarcher
Copy link
Member Author

jessarcher commented Aug 2, 2022

Laravel returns the array of the errors per one field. Is it handled?

No, Inertia only returns the first error for each field. The existing ValidationErrors doesn't display multiple errors per field either.

See: https://github.com/inertiajs/inertia-laravel/blob/540b953ec383364264f9bd633849db16560a4461/src/Middleware.php#L159

@taylorotwell taylorotwell marked this pull request as ready for review August 3, 2022 14:41
@taylorotwell taylorotwell merged commit 3fc804a into 1.x Aug 3, 2022
@taylorotwell taylorotwell deleted the react-input-error branch August 3, 2022 20:11
slimani-dev pushed a commit to slimani-dev/breeze that referenced this pull request Jan 21, 2023
* Add InputError component for React

* Display validation errors alongside the fields
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.

4 participants