-
Notifications
You must be signed in to change notification settings - Fork 825
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
Display validation errors alongside the fields [Inertia] #1115
Conversation
My 0.0002 cents: @weavdale kindly revert the formatting changes. |
@SamuelMwangiW, I tried to figure out the coding style Laravel is using for Javascript, but didn't want to spend a lot of time on it since the docs say StyleCI will fix it during merge. https://laravel.com/docs/9.x/contributions#styleci |
@@ -82,6 +81,7 @@ const submit = () => { | |||
class="mt-1 block w-full" | |||
autocomplete="one-time-code" | |||
/> | |||
<JetInputError class="mt-2" :message="form.errors.code" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a little unfortunate that this needs to be code
rather than recovery_code
, but it looks like Fortify puts the error here even when it's the recovery code that was attempted. The only time an error will appear under recovery_code
is when the provided recovery code is not a string, and I don't think can ever happen in normal usage of the app.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've created a PR for Fortify to fix this: laravel/fortify#401
If that PR is accepted, this will need to change to:
<JetInputError class="mt-2" :message="form.errors.code" /> | |
<JetInputError class="mt-2" :message="form.errors.recovery_code" /> |
If that PR is not accepted, it might be a good idea to change it to something like this (untested):
<JetInputError class="mt-2" :message="form.errors.code" /> | |
<JetInputError class="mt-2" :message="form.errors.recovery_code ?? form.errors.code" /> |
Will let @jessarcher make any PRs here if needed - we are doing some refactoring on Jetstream. |
Update the Inertia stack to match the Breeze Vue components.
See @jessarcher pull request in Breeze laravel/breeze#175