diff --git a/src/shared/components/lazyMobXTable/LazyMobXTable.tsx b/src/shared/components/lazyMobXTable/LazyMobXTable.tsx index 2dbedd4ae7e..e7f2e8b5d85 100644 --- a/src/shared/components/lazyMobXTable/LazyMobXTable.tsx +++ b/src/shared/components/lazyMobXTable/LazyMobXTable.tsx @@ -5,9 +5,9 @@ import { action, computed, IReactionDisposer, + makeObservable, observable, reaction, - makeObservable, } from 'mobx'; import { observer, Observer } from 'mobx-react'; import './styles.scss'; @@ -1129,6 +1129,8 @@ export default class LazyMobXTable extends React.Component< textBeforeButtons: this.store.paginationStatusText, groupButtons: false, bsStyle: 'primary', + isResultLimitedAtMaxPage: + this.props.isResultLimited && this.isAtMaxPage(), }; // override with given paginationProps if they exist if (this.props.paginationProps) { @@ -1322,14 +1324,17 @@ export default class LazyMobXTable extends React.Component< ); } + private isAtMaxPage() { + return this.store.maxPage > 0 && this.store.page === this.store.maxPage; + } + render() { return (
{this.getTopToolbar} {this.getTable} {this.props.isResultLimited && - this.store.maxPage > 0 && - this.store.page === this.store.maxPage && ( + (this.store.showingAllRows || this.isAtMaxPage()) && (
You've reached the maximum viewable records.{' '} diff --git a/src/shared/components/paginationControls/PaginationControls.tsx b/src/shared/components/paginationControls/PaginationControls.tsx index e445e7e576f..f5b4749e4dc 100644 --- a/src/shared/components/paginationControls/PaginationControls.tsx +++ b/src/shared/components/paginationControls/PaginationControls.tsx @@ -42,6 +42,7 @@ export interface IPaginationControlsProps { groupButtons?: boolean; hidePaginationIfOnePage?: boolean; bsStyle?: 'default' | 'primary' | 'success' | 'info' | 'warning'; + isResultLimitedAtMaxPage?: boolean; } @observer @@ -142,6 +143,7 @@ export class PaginationControls extends React.Component< id="showMoreButton" bsSize="sm" disabled={ + this.props.isResultLimitedAtMaxPage || !this.props.itemsPerPageOptions || !this.props.itemsPerPage || !this.props.totalItems ||