Skip to content

Commit

Permalink
fix: fixed pagination infinity pages (#166)
Browse files Browse the repository at this point in the history
Co-authored-by: Alexey Gryzin <[email protected]>
  • Loading branch information
feelsbadmans and Alexey Gryzin authored Oct 9, 2023
1 parent e8f3e58 commit 4de5b30
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/YagrCore/plugins/legend/legend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ export default class LegendPlugin {
const itemsRowsPerPage = rowsPerPage - 1;
const itemsPageSize = Math.min(itemsRowsPerPage * rowHeight, maxPossiblePlace);
const paginatedPageSize = Math.min(rowsPerPage * rowHeight, maxPossiblePlace);
const paginated = requiredHeight > itemsPageSize;
const paginated = requiredHeight > itemsPageSize && itemsPageSize > 0;
const requiredSpace = Math.min(paginated ? paginatedPageSize : itemsPageSize, requiredHeight);
const pages = Math.ceil(requiredHeight / itemsPageSize);
const additionalSpace = paginated ? this.VERTICAL_PADDING + PAGINATION_BUTTON_HEIGHT : this.VERTICAL_PADDING;
Expand Down

0 comments on commit 4de5b30

Please sign in to comment.