Skip to content
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

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

Open
olilam opened this issue Sep 13, 2016 · 5 comments
Open

Comments

@olilam
Copy link

olilam commented Sep 13, 2016

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

@dhilt
Copy link
Member

dhilt commented Dec 19, 2016

@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.

@olilam
Copy link
Author

olilam commented Dec 20, 2016

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).

@dhilt
Copy link
Member

dhilt commented Dec 20, 2016

@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?

@olilam
Copy link
Author

olilam commented Apr 7, 2017

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.

@dhilt
Copy link
Member

dhilt commented Apr 7, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants