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

Collection Repeat and remember scroll position #1654

Closed
mhartington opened this issue Jun 20, 2014 · 10 comments
Closed

Collection Repeat and remember scroll position #1654

mhartington opened this issue Jun 20, 2014 · 10 comments

Comments

@mhartington
Copy link
Contributor

From the forum :
http://forum.ionicframework.com/t/collection-repeat-in-tabs-and-rememberscrollposition/5912/2

If you use collection repeat with tabs, the scroll position isn't remembered when you switch tabs.

Affected Version: Nightly
Codepen: Demo Here

Side Note: There's a little wonky-ness with collection repeat, not sure if it's just me. But if you resize the browser or scroll, the new items kind of animate in.

@ajoslin
Copy link
Contributor

ajoslin commented Jun 20, 2014

If you use transition:all it will do some wonky stuff transitioning the transform of the elements.

This should be noted in the docs.

@mhartington
Copy link
Contributor Author

Woops ha, the animation was added for another example, thanks @ajoslin !

Still the issue with scroll position remains.

@zelphir
Copy link

zelphir commented Jun 20, 2014

@mhartington From your codepen it seems that going back to the back now keeps the position, but it doesn't work if you switch tab!

@mhartington
Copy link
Contributor Author

But it should keep it's position when you switch tabs

@zelphir
Copy link

zelphir commented Jun 20, 2014

Not for me...

Scenario 1:
scroll... click on one of the items, then go back --> scroll position OK

Scenario 2:
scroll... change tab, change again tab --> scroll position LOST

@mhartington
Copy link
Contributor Author

Updated my comment...still pretty early over here 😄

It should keep its scroll position when you switch tabs, but right now it is not doing that.

@zelphir
Copy link

zelphir commented Jun 20, 2014

That's correct!

@ajoslin
Copy link
Contributor

ajoslin commented Jun 24, 2014

Fixed, read the commit message for details

@zelphir
Copy link

zelphir commented Jun 25, 2014

@ajoslin Now it remembers the scroll position, but... It's slow if the list/lists are long (and contain images)... There is a lag, when you go back or change tab... it starts from the top and then scroll to the position... it's not very nice to see this effect!

Maybe add a delay and render the ion-content only when the scroll is at the right position.

The lag is only visible on real devices, not in the browser or ios emulator.

@erperejildo
Copy link

how can I implement this on Ionic 3?

@ionic-team ionic-team locked and limited conversation to collaborators May 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants