bm-core-ui 2.9.1 → 2.9.2

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.
@@ -1679,12 +1679,39 @@ BMCollectionViewFlowLayout.prototype = BMExtend(Object.create(BMCollectionViewLa
1679
1679
  return;
1680
1680
  }
1681
1681
 
1682
+ // When the scrollbar offset is used, invalidate any measurement that exceeds the available space.
1683
+ if (this._expectedCellSize && this._collectionView.scrollBarSize) {
1684
+ switch (this.orientation) {
1685
+ case BMCollectionViewFlowLayoutOrientation.Horizontal:
1686
+ // Determine the available height.
1687
+ const insetHeight = this._sectionInsets.top + this._sectionInsets.bottom;
1688
+ const paddingHeight = this._topPadding + this._bottomPadding;
1689
+ const height = this._collectionView.frame.size.height - insetHeight - paddingHeight - this._collectionView.scrollBarSize;
1690
+
1691
+ // In horizontal mode, invalidate the measurements for cells that are too tall.
1692
+ this._collectionView.invalidateMeasuredSizeOfCellsWithBlock((size) => {
1693
+ return size.height > height;
1694
+ });
1695
+ break;
1696
+ default:
1697
+ // Determine the available width.
1698
+ const insetWidth = this._sectionInsets.left + this._sectionInsets.right;
1699
+ const width = this._collectionView.frame.size.width - insetWidth - this.collectionView.scrollBarSize;
1700
+
1701
+ // In default (vertical) mode, invalidate the measurements for cells that are too wide.
1702
+ this._collectionView.invalidateMeasuredSizeOfCellsWithBlock((size) => {
1703
+ return size.width > width;
1704
+ });
1705
+ break;
1706
+ }
1707
+ }
1708
+
1682
1709
  let iterator = this._prepareLayoutWithScrollbarOffsetGenerator(useOffset);
1683
1710
 
1684
1711
  // When not using automatic cell sizes, the generator function will run to finish from the first
1685
- // invocation of next
1712
+ // invocation of `next`.
1686
1713
  // When using automatic cell sizes, the first iteration will only build a rough outline of the expected layout
1687
- // and must be retained so different portions of the layout can subsequently be computed
1714
+ // and must be retained so different portions of the layout can subsequently be computed.
1688
1715
  let result = iterator.next();
1689
1716
  if (!result.done) {
1690
1717
  this._layoutIterator = iterator;