© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•5mo ago•
1 reply
bogus

Section & manual collapsed via custom headerActions ... Is this a bug?

Hello,

I have a "Section" with custom headerActions...
When I click on an action, I want to change the state of the section
I tried several methods, but it doesn't work.
Filament v3 & v4

Thanks for any help!




 Section::make('test_1')
      ->live()
      ->collapsed()
      ->collapsed(fn (callable $get): bool => ! $get('is_active_test_1'))
      ->headerActions([
          Action::make('activate_1')
              ->action(function (callable $get, callable $set, Section $component) {
                  $status = !$get('is_active_test_1');
                  $set('is_active_test_1', $status);
              }),
      ])
      ->schema([
          Toggle::make('is_active_test_1')
              ->label('is_active_test_1')
              ->default(false),
          TextInput::make('some_input_1'),
      ]), 
 Section::make('test_1')
      ->live()
      ->collapsed()
      ->collapsed(fn (callable $get): bool => ! $get('is_active_test_1'))
      ->headerActions([
          Action::make('activate_1')
              ->action(function (callable $get, callable $set, Section $component) {
                  $status = !$get('is_active_test_1');
                  $set('is_active_test_1', $status);
              }),
      ])
      ->schema([
          Toggle::make('is_active_test_1')
              ->label('is_active_test_1')
              ->default(false),
          TextInput::make('some_input_1'),
      ]), 


this doesn't work either =/

Action::make('activate_2')
    ->action(function (callable $get, callable $set, Section $component) {
        $status = !$get('is_active_test_2');
        $set('is_active_test_2', $status);
        $component->collapsed($status);
    }),
Action::make('activate_2')
    ->action(function (callable $get, callable $set, Section $component) {
        $status = !$get('is_active_test_2');
        $set('is_active_test_2', $status);
        $component->collapsed($status);
    }),



Action::make('activate_3')
    ->action(function (callable $get, callable $set, Section $component, $livewire) {
        $status = !$get('is_active_test_3');
        $set('is_active_test_3', $status);
        $livewire->dispatch('collapse-section', id: $component->getId());
    }),
Action::make('activate_3')
    ->action(function (callable $get, callable $set, Section $component, $livewire) {
        $status = !$get('is_active_test_3');
        $set('is_active_test_3', $status);
        $livewire->dispatch('collapse-section', id: $component->getId());
    }),
image.png
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Section->headerActions->Select
FilamentFFilament / ❓┊help
15mo ago
Default collapsed section does not work
FilamentFFilament / ❓┊help
3y ago
Trigger RelationManager `EditAction` from Infolist Section `headerActions`
FilamentFFilament / ❓┊help
3y ago
Embedded PDF controls missing on collapsed section
FilamentFFilament / ❓┊help
3w ago