Skip to content

Commit

Permalink
remove lazy load for page with only relation manager or widget (#1521)
Browse files Browse the repository at this point in the history
some pages are using widget & relation manager as the only
section/component in the page, and with the lazy load enabled by default
in Filament, this causes those pages to be empty on initial load and
have slight flicker
  • Loading branch information
wychoong authored Jan 31, 2024
1 parent ade1410 commit 5db295f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

class CustomerGroupRelationManager extends RelationManager
{
protected static bool $isLazy = false;

protected static string $relationship = 'customerGroups';

public function isReadOnly(): bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ class ProductOptionsWidget extends BaseWidget implements HasActions, HasForms

public bool $configuringOptions = false;

protected static bool $isLazy = false;

public function mount()
{
$this->configureBaseOptions();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

class ChannelRelationManager extends RelationManager
{
protected static bool $isLazy = false;

protected static string $relationship = 'channels';

public function isReadOnly(): bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

class MediaRelationManager extends RelationManager
{
protected static bool $isLazy = false;

protected static string $relationship = 'media';

public string $mediaCollection = 'default';
Expand Down

0 comments on commit 5db295f

Please sign in to comment.