Skip to content

Dashboard select filter reloads all the widget data unnecessarily #18535

@mansoorkhan96

Description

@mansoorkhan96

Package

filament/filament

Package Version

v4.2.2

Laravel Version

v12.38.1

Livewire Version

v3.6.4

PHP Version

8.4.14

Problem description

I am filtering widget data by following this guide: https://filamentphp.com/docs/4.x/widgets/overview#filtering-widget-data. The widget data is reloaded before even selecting an option.

I have a Dashboard page with filters form. When opening the select dropdown, it reloads all the widgets available on page and runs all the queries even before showing the select drop down. This delays the select drop down options until all the widget data is reloaded. Once all the queries are run and the request finishes, thats when it populates the options for select field.

I have also tried Filtering widget data using an action modal
But same problem with Modal as well, even clicking the Modal action button reloads the data and runs all the queries before even opening the Modal.

Discord Discussion URL: https://discord.com/channels/883083792112300104/1440212167616892999

Expected behavior

Clicking on select field should not reload the widget data unless an option selected.

Steps to reproduce

  1. Clone the repo
  2. Follow the installation guide in README
  3. Open Filament admin panel at /admin
  4. Open Up DebugBar. Click on Group select field and you will see that it creates a new Livewire request which shows the query for getting groups but also a query for Users count.

Reproduction repository (issue will be closed if this is not valid)

https://github.com/mansoorkhan96/filament-widget-issue

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    Todo

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions