-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Weird scroll behavior with md-virtual-repeat-container #4169
Comments
one more issue I just noticed (and updated the codepen to show it): the items won't fill horizontally all the way to the scrollbar |
Can definitely confirm this, on Chrome Version 44.0.2403.155 (64-bit) Looking around, I found that in VirtualRepeatContainerController.prototype.getScrollSize I'm pretty should match whichever of these is in use, the bug is probably arising from this mismatch. Another note: It doesn't seem to occur for me if the window is fullscreen, even if I have the debug tools open and they're shrinking the effective page size, and even if I resize the debug tools. |
+1 seeing the same problems here when the container is resized |
Thank you for this sample on codepen.io. I don't know if this will make sense but. How would this work with large datasets from a DB and a buffer. thanks |
I have the same issue, but only when I use Here's a demo: |
Yep - changing your plunk seems to confirm that - if I change either the |
This seems to be caused by a css interaction. |
I tried changing the handleScroll_ function to get a work around for the above issue (for vertical case only )and it seems that my changes are working fine for my case. Sadly, I dont have the kind of skills to test it extensively to make sure that all types of cases are covered. There is a probability that my approach was completely wrong and it was just a fluke for my case. I am sharing my code in case someone is lucky and his/her problem gets solved.
|
I was having issues with the bottomless scrolling. I added this to mostly fix the problem. VirtualRepeatContainerController.prototype.handleScroll_ = function() { var offset = this.isHorizontal() ? this.scroller.scrollLeft : this.scroller.scrollTop; if (offset === this.scrollOffset) return; var itemsLength = this.repeater.itemsLength; var itemSize = this.repeater.getItemSize(); if (!itemSize) return; var numItems = Math.max(0, Math.floor(offset / itemSize) - NUM_EXTRA); if(itemsLength > this.repeater.endIndex || offset < this.scrollOffset){ var transform = this.isHorizontal() ? 'translateX(' : 'translateY('; transform += (numItems * itemSize) + 'px)'; this.scrollOffset = offset; this.offsetter.style.webkitTransform = transform; this.offsetter.style.transform = transform; } if (this.bindTopIndex) { var topIndex = Math.floor(offset / itemSize); if (topIndex !== this.topIndex && topIndex < this.repeater.itemsLength) { this.topIndex = topIndex; this.bindTopIndex.assign(this.$scope, topIndex); if (!this.$rootScope.$$phase) this.$scope.$digest(); } } this.repeater.containerUpdated(); }; |
+1 in 1.0-rc5. I've removed padding and margins from the md-virtual-repeat-container but still get the issue in both Safari 8.0.7 (10600.7.12) and Chrome 47.0.2526.106. |
Try using md-item-size. |
Fixes angular#6279 Might also fix angular#4169
…t also fix angular#4169 Closes angular#6990
it's probably easiest to just demostrate, so here's a codepen: http://codepen.io/matgr1/pen/BNEEmW
and here are the problems:
1.) scroll to the bottom, shrink the output pane to maybe half the height, start scrolling down again - it keeps going forever just repeating the last few items
2.) increase the output pane height (to larger than the original) - the numbers no longer go all the way to the bottom
The text was updated successfully, but these errors were encountered: