-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Widget lazy loading not working when displaying the widget using the make() method #9066
Comments
I've found why this happens:
You can work around this by passing TestWidget::make([
'lazy' => true,
]) I will leave this issue open though, since I feel like the default properties should always be merged in. However, there must be a reason for the current behavior, so I will leave this to @danharrin. |
i also noticed that a table widget acts different when you display it using make() |
Fixed in latest version |
I'm not sure if it's related to this but for me, widget lazy loading is not using the // Throws Livewire\Exceptions\ComponentNotFoundException
// Unable to find component: [app.filament.widgets.git-hub-account-widget]
// So it does not seem to be using the $view property, and instead tries to parse the class name.
// Setting $isLazy to false works, and the $view property seems to be used.
class GitHubAccountWidget extends Widget
{
protected static string $view = 'filament.widgets.github-account-widget';
protected static bool $isLazy = true;
} I'm registering the widget in a page using the class constant syntax like this: class AccountSettingsPage extends MyProfilePage
{
protected function getHeaderWidgets(): array
{
return [
GitHubAccountWidget::class,
];
}
} Edit: See #10663 |
Please create a new issue as I doubt the existing reproduction repository fits it |
Package
filament/filament
Package Version
v3.0.74
Laravel Version
v10.28.0
Livewire Version
v3.0.8
PHP Version
PHP 8.2.9
Problem description
when i display a widget using the make() method the lazy loading does not work
i want to use the make() method because i want to pass properties to the widget
Expected behavior
i expect the widget to lazy load when i display it using the make() method
Steps to reproduce
you will find two widgets in the dashboard (one widget displayed twice)
the dashboard class is located at "app/Filament/Pages" and the widget class is located at "app/Filament/Widgets"
the first widget is displayed using the make() method and it is not lazy loaded
the second widget is displayed using the class name and it is lazy loaded
Reproduction repository
https://github.com/tabatii/filament-bugs
Relevant log output
No response
The text was updated successfully, but these errors were encountered: