Browse Source

Fix bug with end index = 0

pull/6419/head
mohamedsalem401 2 years ago
parent
commit
a643411f6d
  1. 4
      packages/core/src/data_sources/model/data_collection/ComponentDataCollection.ts

4
packages/core/src/data_sources/model/data_collection/ComponentDataCollection.ts

@ -55,8 +55,8 @@ export default class ComponentDataCollection extends Component {
getItemsCount() { getItemsCount() {
const items = this.getDataSourceItems(); const items = this.getDataSourceItems();
const startIndex = Math.max(0, this.getConfigStartIndex() || 0); const startIndex = Math.max(0, this.getConfigStartIndex() ?? 0);
const configEndIndex = this.getConfigEndIndex() || Number.MAX_VALUE; const configEndIndex = this.getConfigEndIndex() ?? Number.MAX_VALUE;
const endIndex = Math.min(items.length - 1, configEndIndex); const endIndex = Math.min(items.length - 1, configEndIndex);
const count = endIndex - startIndex + 1; const count = endIndex - startIndex + 1;

Loading…
Cancel
Save