Use FilterAction in a custom widget

Hi,

I am trying to use FilterAction in a custom widget. It appears beside other action button but does not open the filter drop-down.

Is it possible to use FilterAction just like other actions? Am i missing something?

class CustomStatWidget extends Widget implements HasActions, HasForms
{
  use HasFiltersAction;
  use HasFiltersForm;
  use InteractsWithActions;
  use InteractsWithForms;
  use InteractsWithPageFilters;

  public function applyFiltersAction(): FilterAction
  {
      return FilterAction::make()
          ->label('')
          ->icon('heroicon-o-funnel')
          ->color('gray')
          ->iconButton()
          ->form([
              DatePicker::make('startDate'),
              DatePicker::make('endDate'),
              // ...
          ])
          ->action(function () {
  
          });
  }
}


<div class="flex items-center gap-2">
    {{ $this->createResourceAction }}
    {{ $this->viewResourceAction }}
    {{ $this->applyFiltersAction }}
</div>
Was this page helpful?