filamentphp / filament

A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS.
https://filamentphp.com
MIT License
18.98k stars 2.93k forks source link

Disappearing footer widgets on a dashboard page #8300

Closed alexjustesen closed 11 months ago

alexjustesen commented 1 year ago

Package

filament/filament

Package Version

v3.0.39

Laravel Version

v10.22.0

Livewire Version

v3.0.1

PHP Version

PHP 8.2

Problem description

  1. On a page that has footer widgets (1 or more): the first widget will be dropped from the view and disappear when an action button is clicked.
  2. On a page that has footer widgets (1 or more): the first widget will be dropped from the view and disappear after a few seconds when wire:poll is present in a page's view.
  3. Worth noting this is not the case for any header widgets.

From action button click

https://github.com/filamentphp/filament/assets/1144087/dce7d61a-b040-4a5a-9217-24aacbcb676b

From wire poll in page

https://github.com/filamentphp/filament/assets/1144087/d49e4d8f-cf5d-401a-9269-da8e4c2bac01

Expected behavior

Widgets should remain rendered on the page.

Steps to reproduce

  1. Fresh Laravel install
  2. Fresh Filament install
  3. Create a custom Dashboard page following the docs
  4. Add more than one widget to getFooterWidgets()

Reproduction repository

Relevant log output

n/a
alexjustesen commented 1 year ago

Past related issues: #7567 and #8052

alexjustesen commented 1 year ago

Added https://github.com/alexjustesen/filament-houdini-widgets to track issues in a fresh repo and added better videos to show it happening.

zepfietje commented 1 year ago

Is this still an issue in the latest version of Livewire?

alexjustesen commented 1 year ago

Is this still an issue in the latest version of Livewire?

Give me a day or so to update the repo and test again.

zepfietje commented 1 year ago

Sure, no rush, @alexjustesen!

ImJustToNy commented 1 year ago

Having same issue on Livewire 3.0.5, Filament 3.0.62, PHP 8.2.10, Laravel 10.24

zepfietje commented 1 year ago

Okay, thanks for confirming, @ImJustToNy.

alexjustesen commented 1 year ago

@zepfietje repo updated with the latest versions of the dependencies. Issues still exist.

sawirricardo commented 1 year ago

I confirm this issue still exists

alexjustesen commented 11 months ago

Updated with the latest dependencies, confirmed still an issue.

danharrin commented 11 months ago

Fixed by #10054.

ImJustToNy commented 11 months ago

Fixed by #10054.

Thank you!

ImJustToNy commented 11 months ago

Fixed by #10054.

~~It fixed the issue in some places, but it still persists in others.

From my understanding issue appears when both Header and Footer widgets are declared.

Minimal reproduction code in my case is:


namespace App\Filament\Resources\UserResource\Pages;

use App\Filament\Resources\UserResource;

class ListUsers  extends ListRecords
{
    protected static string $resource = UserResource::class;

    protected function getHeaderWidgets(): array
    {
        return [
            UserResource\Widgets\HeaderWidget::class,
        ];
    }

    protected function getFooterWidgets(): array
    {
        return [
            UserResource\Widgets\FooterWidget::class,
        ];
    }
}
namespace App\Filament\Resources\UserResource\Widgets;

use Filament\Widgets\StatsOverviewWidget as BaseWidget;
use Filament\Widgets\StatsOverviewWidget\Stat;

class HeaderWidget extends BaseWidget
{
    protected function getStats(): array
    {
        return [
            //
        ];
    }
}
namespace App\Filament\Resources\UserResource\Widgets;

use Filament\Widgets\StatsOverviewWidget as BaseWidget;
use Filament\Widgets\StatsOverviewWidget\Stat;

class FooterWidget extends BaseWidget
{
    protected function getStats(): array
    {
        return [
            //
        ];
    }
}

@danharrin ~~

danharrin commented 11 months ago

I cannot reproduce, please create a new repository

ImJustToNy commented 11 months ago

I cannot reproduce, please create a new repository

My bad, checked it on the wrong branch, everything works perfectly now :sweat_smile:. Thank you.