Loading indicator when showing/hiding dependent fields via select
Hi all
I've got a form with several hidden sections I switch between using a 'type' select field. The sections have
->hidden(fn (Get $get) => $get('type') !== ......)
on them.
There's a noticeable delay after selecting an option before the correct section appears. The server is in Europe and I'm in Australia so the latency is pretty high. Moving servers isn't an option unfortunately.
I'd like to add a loading indicator to improve the UX. Ideally, I'd like to remove the currently displayed section as soon as an option is selected (without waiting for the backend request) and show a loading indicator until the new section appears. Which probably means doing something client-side with Alpine...
Any suggestions on how I could do that? Thanks!Solution:Jump to solution
https://filamentphp.com/docs/3.x/support/blade-components/loading-indicator
Or:
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.
5 Replies
Anyone?
It's really easy
Solution
https://filamentphp.com/docs/3.x/support/blade-components/loading-indicator
Or:
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.
@toeknee Thanks, adding an indicator using
View
was exactly what I needed. Had to use wire.loading.class.remove="hidden"
to get it to work. Adding visible wasn't overriding hiddenGreat stuff