How would I go about having a text field use a loading indicator
Is there an existing way or can anyone suggest an approach to having a text field, which accepts data, and when the user clicks away (blur) - calls an event (like afterStateUpdated()) which could permit a loading indicator that loads while the afterState process occurs (such as validating the data with an API).
I can create multiple afterStateUpdated() hooks, but they are called sequentially before filtering back to the UI, so I can't use a variable in the suffix() label within a closure (which seems hacky anyway.
Seems like a pretty common use-case - it's 'like' the Select getSearchResultsUsing() but different.
Solution:Jump to solution
It's already possible with the wire loading.
https://v2.filamentphp.com/tricks/forms-loading-inidicator...
Filament
Forms Loading Inidicator by Tony Partridge - Tricks - Filament
Filament is a collection of tools for rapidly building beautiful TALL stack apps, designed for humans.
2 Replies
Solution
It's already possible with the wire loading.
https://v2.filamentphp.com/tricks/forms-loading-inidicator
Filament
Forms Loading Inidicator by Tony Partridge - Tricks - Filament
Filament is a collection of tools for rapidly building beautiful TALL stack apps, designed for humans.
Yeah it kind of worked, as usual about five minutes after I finally succumbed to contacting the brains trust. I did see that link before. Handy because it means I’ll delve more into live wire tricks. The end time for the animation seems very quick, not in line with the sleep I had in afterStateUpdated. I’ll tinker some more because a clean generic solution to this I think would be useful in many of my applications - cheers!