Skip to content

Commit

Permalink
Table: additional condition to display perPage selector (#601)
Browse files Browse the repository at this point in the history
* Fix table pagination X scroll

* Additional condition to display perPage selector

Hide perPage selection on empty tables

---------

Co-authored-by: Robson Tenório <[email protected]>
  • Loading branch information
c-perez and robsontenorio authored Sep 3, 2024
1 parent 74d281f commit 25deb82
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/View/Components/Pagination.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function modelName(): ?string

public function isShowable(): bool
{
return ! empty($this->modelName()) && $this->rows instanceof LengthAwarePaginator;
return ! empty($this->modelName()) && $this->rows instanceof LengthAwarePaginator && $this->rows->isNotEmpty();
}

public function render(): View|Closure|string
Expand Down

0 comments on commit 25deb82

Please sign in to comment.