Skip to content

Commit

Permalink
fix bug with nav button
Browse files Browse the repository at this point in the history
right nav button was not disabled when total_pages=0
  • Loading branch information
creme332 committed May 31, 2024
1 parent 09eaa01 commit fba4a7f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/views/Pagination.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function displayNavigationButton(int $current_page_number, int $total_pages, str
$link_content = htmlspecialchars($is_left ? "<" : ">");
$className = "page-item";

if (($current_page_number === 1 && $is_left) || ($current_page_number === $total_pages && !$is_left)) {
if (($current_page_number <= 1 && $is_left) || ($current_page_number >= $total_pages && !$is_left)) {
$className .= " disabled";
}

Expand Down

0 comments on commit fba4a7f

Please sign in to comment.