Skip to content

Commit

Permalink
Fix responsive action bug (#1640)
Browse files Browse the repository at this point in the history
  • Loading branch information
luanfreitasdev authored Aug 13, 2024
1 parent ea16460 commit 4108ef2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
8 changes: 8 additions & 0 deletions resources/views/components/cols.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@
$isFixedOnResponsive = true;
}
if (data_get($column, 'isAction') &&
in_array(
\PowerComponents\LivewirePowerGrid\Responsive::ACTIONS_COLUMN_NAME,
data_get($this->setUp, 'responsive.fixedColumns')
)) {
$isFixedOnResponsive = true;
}
if ($column->fixedOnResponsive) {
$isFixedOnResponsive = true;
}
Expand Down
5 changes: 4 additions & 1 deletion src/PowerGridComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,15 @@ private function getTheme(): array
return convertObjectsToArray((array) $themeBase->apply());
}

return Cache::rememberForever('powerGridTheme_' . $class, function () use ($class) {
/** @var array $theme */
$theme = Cache::rememberForever('powerGridTheme_' . $class, function () use ($class) {
/** @var ThemeBase $themeBase */
$themeBase = PowerGrid::theme($class);

return convertObjectsToArray((array) $themeBase->apply());
});

return $theme;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Providers/PowerGridServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ private function macros(): void

$perPage = $perPage ?: $this->model->getPerPage();

$results = $this->model->newCollection( //@phpstan-ignore-line
$results = $this->model->newCollection(
$engine->map(
$this,
$rawResults = $engine->paginate($this, $perPage, $page),
Expand Down

0 comments on commit 4108ef2

Please sign in to comment.