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!
Was this page helpful?