Skip to content

Show loading feedback on Toggle and Switch - #2828

Merged
calebporzio merged 2 commits into
mainfrom
codex/toggle-loading
Sep 15, 2026
Merged

calebporzio merged 2 commits into
mainfrom
codex/toggle-loading

Conversation

@calebporzio

@calebporzio calebporzio commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

When a Toggle or Switch change triggers a Livewire request, provide pending feedback from data-loading. Toggle replaces its contents with a centered spinner without changing its dimensions. Standard Switch uses its dimmed disabled appearance with no spinner. Both suppress pointer interaction while pending.

The companion switch JavaScript change blocks keyboard and label activation and exposes busy/disabled accessibility state, while preserving focus and the existing disabled attribute. The docs demonstrate wire:model="active" wire:change="save".

Validation: 28 focused Switch/Toggle browser tests pass. Rebuilt assets and verified both controls in the Laravel playground plus the real Flux docs example, including loading cleanup, single saves, unchanged geometry, and retained keyboard focus. Generated bundles are left for the release build.

Companions: https://github.com/livewire/flux-pro/pull/584 and https://github.com/livewire/flux-docs/pull/230.

@calebporzio calebporzio changed the title Show Toggle loading feedback for Livewire requests Show loading feedback on Toggle and Switch Sep 15, 2026
@calebporzio
calebporzio merged commit d0f8662 into main Sep 15, 2026
1 check passed
@calebporzio
calebporzio deleted the codex/toggle-loading branch September 15, 2026 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant