diff --git a/packages/fineui/src/base/collection/collection.js b/packages/fineui/src/base/collection/collection.js index e66d677b7..2019bfa7a 100644 --- a/packages/fineui/src/base/collection/collection.js +++ b/packages/fineui/src/base/collection/collection.js @@ -400,12 +400,13 @@ export class CollectionView extends Widget { } catch (e) {} this._calculateChildrenToRender(); } + setScrollLeft(scrollLeft) { if (this.options.scrollLeft === scrollLeft) { return; } this._scrollLock = true; - this.options.scrollLeft = clamp(scrollLeft || 0, 0, this._getMaxScrollLeft()); + this.options.scrollLeft = clamp(scrollLeft || 0, 0, this._getMaxScrollLeft() || scrollLeft); this._debounceRelease(); this.element.scrollLeft(this.options.scrollLeft); this._calculateChildrenToRender(); @@ -416,7 +417,7 @@ export class CollectionView extends Widget { return; } this._scrollLock = true; - this.options.scrollTop = clamp(scrollTop || 0, 0, this._getMaxScrollTop()); + this.options.scrollTop = clamp(scrollTop || 0, 0, this._getMaxScrollTop() || scrollTop); this._debounceRelease(); this.element.scrollTop(this.options.scrollTop); this._calculateChildrenToRender();