ng-virtual-list 20.11.9 → 20.11.10

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.
@@ -6097,7 +6097,7 @@ class NgVirtualListComponent {
6097
6097
  }
6098
6098
  })).subscribe();
6099
6099
  const $preventScrollSnapping = this.$preventScrollSnapping;
6100
- $preventScrollSnapping.pipe(takeUntilDestroyed(), filter$1(v => !!v), debounceTime(0), tap(() => {
6100
+ $preventScrollSnapping.pipe(takeUntilDestroyed(), filter$1(v => !!v), tap(() => {
6101
6101
  if (this._readyForShow) {
6102
6102
  this._trackBox.isScrollEnd;
6103
6103
  this._trackBox.isScrollStart = this._trackBox.isScrollEnd = false;
@@ -6180,12 +6180,12 @@ class NgVirtualListComponent {
6180
6180
  this.resetBoundsSize(isVertical, totalSize);
6181
6181
  this.createDisplayComponentsIfNeed(displayItems);
6182
6182
  this.tracking();
6183
+ this.snappingHandler();
6183
6184
  const delta = this._trackBox.delta, scrollPositionAfterUpdate = Math.round(actualScrollSize + delta), roundedScrollPositionAfterUpdate = Math.round(scrollPositionAfterUpdate), roundedMaxPositionAfterUpdate = Math.round(totalSize - viewportSize);
6184
6185
  if (this._isSnappingMethodAdvanced) {
6185
6186
  this.updateRegularRenderer();
6186
6187
  }
6187
6188
  scroller.delta = delta;
6188
- this.snappingHandler();
6189
6189
  if ((snapScrollToStart && this._trackBox.isSnappedToStart) ||
6190
6190
  (snapScrollToStart && currentScrollSize <= MIN_PIXELS_FOR_PREVENT_SNAPPING)) {
6191
6191
  if (currentScrollSize !== roundedScrollPositionAfterUpdate) {
@@ -6226,11 +6226,11 @@ class NgVirtualListComponent {
6226
6226
  if (emitUpdate) {
6227
6227
  this._$update.next(this.getScrollStateVersion(totalSize, this._isVertical ? scroller.scrollTop : scroller.scrollLeft, cacheVersion));
6228
6228
  }
6229
- this._trackBox.isScrollEnd;
6230
6229
  return;
6231
6230
  }
6232
- if ((scrollPositionAfterUpdate >= 0 && scrollPositionAfterUpdate < roundedMaxPositionAfterUpdate) ||
6233
- (scrollSize !== roundedMaxPositionAfterUpdate || currentScrollSize !== scrollPositionAfterUpdate)) {
6231
+ if (scrollSize !== scrollPositionAfterUpdate &&
6232
+ ((scrollPositionAfterUpdate >= 0 && scrollPositionAfterUpdate < roundedMaxPositionAfterUpdate) ||
6233
+ (scrollSize !== roundedMaxPositionAfterUpdate || currentScrollSize !== scrollPositionAfterUpdate))) {
6234
6234
  this._trackBox.clearDelta();
6235
6235
  if (this._readyForShow) {
6236
6236
  this.emitScrollEvent(true, false, userAction);
@@ -6243,8 +6243,8 @@ class NgVirtualListComponent {
6243
6243
  if (emitUpdate) {
6244
6244
  this._$update.next(this.getScrollStateVersion(totalSize, this._isVertical ? scroller.scrollTop : scroller.scrollLeft, cacheVersion));
6245
6245
  }
6246
+ return;
6246
6247
  }
6247
- return;
6248
6248
  }
6249
6249
  if (emitUpdate) {
6250
6250
  this._$update.next(this.getScrollStateVersion(totalSize, this._isVertical ? scroller.scrollTop : scroller.scrollLeft, cacheVersion));
@@ -6286,19 +6286,10 @@ class NgVirtualListComponent {
6286
6286
  const scrollHandler = (userAction = false) => {
6287
6287
  const scroller = this._scrollerComponent();
6288
6288
  if (!!scroller) {
6289
- const isVertical = this._isVertical, bounds = this._bounds(), listBounds = this._listBounds(), scrollSize = (isVertical ? scroller.scrollTop : scroller.scrollLeft), maxScrollSize = isVertical ? (listBounds?.height ?? 0) - (bounds?.height ?? 0) : (listBounds?.width ?? 0) - (bounds?.width ?? 0), actualScrollSize = scrollSize;
6289
+ const isVertical = this._isVertical, scrollSize = (isVertical ? scroller.scrollTop : scroller.scrollLeft), actualScrollSize = scrollSize;
6290
6290
  if (this._readyForShow) {
6291
6291
  if (userAction) {
6292
- if (this._trackBox.isSnappedToStart) {
6293
- if (scrollSize > MIN_PIXELS_FOR_PREVENT_SNAPPING) {
6294
- this._$preventScrollSnapping.next(true);
6295
- }
6296
- }
6297
- if (this._trackBox.isSnappedToEnd) {
6298
- if (scrollSize < (maxScrollSize - MIN_PIXELS_FOR_PREVENT_SNAPPING)) {
6299
- this._$preventScrollSnapping.next(true);
6300
- }
6301
- }
6292
+ this._$preventScrollSnapping.next(true);
6302
6293
  }
6303
6294
  }
6304
6295
  this._scrollSize.set(actualScrollSize);