@internetarchive/collection-browser 2.7.3 → 2.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -434,6 +434,12 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
434
434
  connectedCallback(): void;
435
435
  disconnectedCallback(): void;
436
436
  handleResize(entry: ResizeObserverEntry): void;
437
+ /**
438
+ * Ensures that if we have new results from the data source that are not yet
439
+ * displayed in the infinite scroller, that they are immediately reflected
440
+ * in the tile count.
441
+ */
442
+ private ensureAvailableTilesDisplayed;
437
443
  /**
438
444
  * Updates the data source with the current state of facet readiness for loading,
439
445
  * so that they will begin to load in at the appropriate time according to the
@@ -1137,6 +1137,7 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
1137
1137
  this.disconnectResizeObserver(oldObserver);
1138
1138
  this.setupResizeObserver();
1139
1139
  }
1140
+ this.ensureAvailableTilesDisplayed();
1140
1141
  }
1141
1142
  connectedCallback() {
1142
1143
  var _a;
@@ -1170,6 +1171,19 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
1170
1171
  // Ensure the facet sidebar remains sized correctly
1171
1172
  this.updateLeftColumnHeight();
1172
1173
  }
1174
+ /**
1175
+ * Ensures that if we have new results from the data source that are not yet
1176
+ * displayed in the infinite scroller, that they are immediately reflected
1177
+ * in the tile count.
1178
+ */
1179
+ ensureAvailableTilesDisplayed() {
1180
+ if (this.infiniteScroller &&
1181
+ this.infiniteScroller.itemCount < this.dataSource.size) {
1182
+ this.setTileCount(this.dataSource.endOfDataReached
1183
+ ? this.dataSource.size
1184
+ : this.estimatedTileCount);
1185
+ }
1186
+ }
1173
1187
  /**
1174
1188
  * Updates the data source with the current state of facet readiness for loading,
1175
1189
  * so that they will begin to load in at the appropriate time according to the