-
Notifications
You must be signed in to change notification settings - Fork 107
Show the correct scroll-position if the total length of the element is known #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Well, scroller uses similar approach to force the scroll bar to work. There are padding elements one on top and another on bottom of the viewport. The height of the padding element is adjusted as more elements are retrieved from the dataset. Can you think of some way to make it more useful? |
I'm using ui-scroll for a chat log so most of the time the user starting from the bottom is scrolling up. There are do different things, my testers claim about:
Since all my content is of various length (but at least in average it would always between one or two lines) I still guess that it would help to at least have some kind of point of reference for the user how much content there is still left for them. |
I'm using ui-scroll for displaying simple lists, therefore I know the exact height of every list item. In my current usecase I disabled the infinite scrolling by not loading items with an index of <1 or greater the lists length. As @hohl mentioned, the scrollbar is not informative for the user at all if it's changing the size all the time. The behavior makes sense if the list has infinite scrolling, but not in my case. |
@ftorghele @hohl Scrollbar behavior is controlled by 2 padding elements automatically added to the list - one on top and another one on bottom. The way it is currently done is that initially the height of both of them is set to 0. as the items are removed from DOM, the height of removed items is added to the height of the padding elements. As they are added back the height of the appropriate padding is subtracted from the appropriate padding. From the standpoint of the scroller behavior all of this is not really necessary. I implemented it this way to give the user the feel of how many items are out there without pulling in the entire dataset. I see your point and I am open to suggestions. For instance one way of dong this would be to expose the padding elements through the adapter and this way to give you full control over them |
I also think a solution for this would be very useful. Exposing the padding elements would actually help. |
@AlSherif actually I am working on implementing this. The code is already in the master, I am holding back on documenting and releasing it because I am trying to resolve a few edge cases, still. Check out the 'minIndex' and 'maxIndex' (undocumentd so far) properties on the datasource. You can also assign values to the properties if they are known. The scrollbar will always be adjusted to reflect the |
@mfeingold I checked it out... it seems the newest changes are not reflected in the javascript, I can only find the min/maxIndex in the coffeescript file. |
@AlSherif yeah, we still have no js-artifacts auto deployment, we do it via 'grunt build' and then commit the results... |
@mfeingold alright... so I tested it. It seems to work pretty well, there is only one problem... the scrollbar only shows the proper length after you start scrolling. |
btw, the latest artifacts are in 'master'... |
Yes, I checked out the latest commit of the master branch. Do you have any info on the issue I posted above? |
@dhilt @mfeingold Hi guys, I just wanted to give you some more feedback. We had two issues:
Because of that we went back to use the 1.3.2 version. |
@AlSherif could you please provide us with a repro of your 2nd issue? if it's something serious then we'd like to fix it... |
@dhilt https://github.com/AlSherif/AngularUIScrollDemo. |
@mfeingold @dhilt Any update on this? |
@AlSherif I was able to run your demo, thanks, and here as I see we have an issue of different height items. When I set style="height: 100px" on each row the problem is gone. Right now we are working on scrolling optimization (this branch) and there we have a slightly better behaviour for your case, but we need more time to dig into it. |
@AlSherif check the 1.4.1 version |
Would it be thinkable to add the feature (similar to clusterize.js) that the correct scroll position is shown if the total length of the list is shown?
Clusterize.js inserts a placeholder element on the top and one on the bottom with the height adjusted.
The text was updated successfully, but these errors were encountered: