Validation Strategy: Reward Early; Punish Late #12164
Alex-S-Davies
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I am trying to implement a validation strategy called Reward Early; Punish Late
(see vuelidate/vuelidate#897 & https://www.smashingmagazine.com/2022/09/inline-validation-web-forms-ux/)
I am quite new to Filament but I think I have managed to implement this strategy using the following traits
Input Trait
Livewire Component Trait
Although this works, I really don't think the livewire component should be dealing with any of the logic. Therefore I did refactor this into the following traits:
Input Trait
Livewire Component Trait
Which still leaves some logic in the livewire component (is there something I can do with registerListeners inside the input class instead?), is at least more contained. However, this refactor doesn't work because I think the Input Components gets refreshed on a validation failure. Can anyone help here?
If this idea is useful to others, I would love to see it make it in core.
I would be more than happy to try and make a PR
All reactions