ui-scroll icon indicating copy to clipboard operation
ui-scroll copied to clipboard

"Preserves the scroll on refresh" does not ensure first item visibility

Open olilam opened this issue 9 years ago • 5 comments

When the first item in list is partially visible, refreshing the page causes scrolling to the first item entirely visible. For example, when using https://rawgit.com/angular-ui/ui-scroll/master/demo/persistentScroll/persistentScroll.html, we can make "Item 2" as the first item (not entirely visible): scroll1 Then refreshing the page, makes "Item 3" the first item: scroll2 while the expected behavior would be to still see "Item 2" as in: scroll3

This is even more important when items in list have a "big height".

Any idea on how to solve this?

Thanks in advance,

Olivier

olilam avatar Sep 13 '16 13:09 olilam

@olilam Could you please have a look through https://youtu.be/sGGany5O3HY and say what I'm doing wrong? If my demo is ok while you still have the issue, it would be right if you provide us with a reproducible demo on Plunker or somewhere else.

dhilt avatar Dec 19 '16 17:12 dhilt

Thank you for looking at that! I reproduced the phenomenon in https://youtu.be/0ecJWIMwOtI. I am using Chrome and while checking the issue to make this video, I have noticed that it appears only with the Browser window maximized... I have checked with Firefox and I have the exact same result (issue when browser maximized).

olilam avatar Dec 20 '16 09:12 olilam

@olilam Is it true that the initial load of this demo on your end shows only a bottom part of the 1st item (as I see on your video)? I believe that this is a true problem and this leads to a similar back-jump after refresh. And I still could not reproduce this effect on my Chrome with or without fullscreen mode. What kind of OS are you using? Windosw 7/10, Mac, etc?

dhilt avatar Dec 20 '16 13:12 dhilt

I am really sorry for the delay before answering... To answer your question, yes, it is. On initial load, the 1st item is half hidden. I am on Windows 10. The issue is not there in Edge by the way.

olilam avatar Apr 07 '17 11:04 olilam

I run the demo under Win10 (Chrome, FF, Edge) and I don't see your issue. But I see another problem which is a bit like your problem. FF and Edge have additional 1px scroll down on initial load, which makes next item visible, which makes... https://www.youtube.com/watch?v=stffBXC8eTs&feature=youtu.be

So I can say now that the demo is not ok.

dhilt avatar Apr 07 '17 12:04 dhilt