-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
WIP: Use anonymous blade component for errors #15421
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
base: develop
Are you sure you want to change the base?
Conversation
Signed-off-by: snipe <[email protected]>
PR Summary
In short, these changes focus primarily on improving the user feedback system, ensuring form validation is correctly handled, and improving the overall user experience. |
@@ -0,0 +1,6 @@ | |||
@props(['name']) | |||
@error($name) | |||
<span class="alert-msg"> |
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.
Off the top of my head, I think it'll be a good idea to add {{ $attributes }}
to this line via {{ $attributes->merge(['class' => 'alert-msg']) }}
so stuff passed in is automatically rendered on the component. So something like <x-form-error name="something" class="an-extra-class-here-to-add-with-alert-msg" id="some-id-to-hook-on-to" />
would work.
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 don't think we need that though, since these are specifically for inline form errors which always have the same class.
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.
That's fair but it's not only classes we could pass if we added that line. I don't think we're doing it now but we could pass in an id if we needed to target it with some javascript or something in the future. Not necessary but I usually tend to add {{ $attributes }}
to components by default out of habit.
Still lots more to be done here, and a ton of testing to do