bm-core-ui 2.10.2 → 2.10.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.
|
@@ -4344,7 +4344,7 @@ BMCollectionView.prototype = BMExtend(BM_COLLECTION_VIEW_USE_BMVIEW_SUBCLASS ? O
|
|
|
4344
4344
|
}
|
|
4345
4345
|
|
|
4346
4346
|
do {
|
|
4347
|
-
const startingIndexPath = nextIndexPath;
|
|
4347
|
+
const startingIndexPath = nextIndexPath ?? BMIndexPathNone;
|
|
4348
4348
|
|
|
4349
4349
|
if (!nextIndexPath) {
|
|
4350
4350
|
// If no index path is currently highlighted, highlight the first index path in the data set.
|
|
@@ -5888,6 +5888,10 @@ BMCollectionView.prototype = BMExtend(BM_COLLECTION_VIEW_USE_BMVIEW_SUBCLASS ? O
|
|
|
5888
5888
|
else if (options.horizontalGravity == BMCollectionViewScrollingGravityHorizontal.Right) {
|
|
5889
5889
|
offset.x = rect.origin.x + rect.size.width - this.frame.size.width;
|
|
5890
5890
|
}
|
|
5891
|
+
|
|
5892
|
+
// Make sure the offset doesn't exceed the available area
|
|
5893
|
+
offset.y = Math.min(Math.max(0, offset.y), this._size.height - this.frame.size.height);
|
|
5894
|
+
offset.x = Math.min(Math.max(0, offset.x), this._size.width - this.frame.size.width);
|
|
5891
5895
|
|
|
5892
5896
|
// Scroll to the offset point
|
|
5893
5897
|
if (options.animated) {
|
|
@@ -4664,7 +4664,7 @@ BMCollectionViewFlowLayout.prototype = BMExtend(Object.create(BMCollectionViewLa
|
|
|
4664
4664
|
let previousRow;
|
|
4665
4665
|
|
|
4666
4666
|
// Find the next row, if any
|
|
4667
|
-
if (rowIndex
|
|
4667
|
+
if (rowIndex > 0) {
|
|
4668
4668
|
const previousRowIndex = rowIndex - 1;
|
|
4669
4669
|
previousRow = sectionRows[previousRowIndex];
|
|
4670
4670
|
}
|
|
@@ -4673,7 +4673,8 @@ BMCollectionViewFlowLayout.prototype = BMExtend(Object.create(BMCollectionViewLa
|
|
|
4673
4673
|
let sectionIndex = section - 1;
|
|
4674
4674
|
while (sectionIndex >= 0) {
|
|
4675
4675
|
if (this.collectionView.numberOfObjectsInSectionAtIndex(sectionIndex)) {
|
|
4676
|
-
|
|
4676
|
+
// NOTE: When using automatic cell size, there can be fewer cached sections than there are in the data set
|
|
4677
|
+
previousRow = this.cachedLayout.sections[sectionIndex]?.rows[(this.cachedLayout.sections[sectionIndex]?.rows.length || 0) - 1];
|
|
4677
4678
|
break;
|
|
4678
4679
|
}
|
|
4679
4680
|
sectionIndex--;
|
|
@@ -4803,7 +4804,7 @@ BMCollectionViewFlowLayout.prototype = BMExtend(Object.create(BMCollectionViewLa
|
|
|
4803
4804
|
let sectionIndex = section + 1;
|
|
4804
4805
|
while (sectionIndex < sectionCount) {
|
|
4805
4806
|
if (this.collectionView.numberOfObjectsInSectionAtIndex(sectionIndex)) {
|
|
4806
|
-
nextRow = this.cachedLayout.sections[sectionIndex]
|
|
4807
|
+
nextRow = this.cachedLayout.sections[sectionIndex]?.rows[0];
|
|
4807
4808
|
break;
|
|
4808
4809
|
}
|
|
4809
4810
|
sectionIndex++;
|