Suppose I am rendering a bunch of posts.
{{#each posts}}
{{>post}}
{{/each}}
I am getting a bunch of posts sorted by date.
Posts.find({}, {sort:{name: 1, date:-1}, limit: Session.get('limit')}).fetch()
I've got some reactive scrolling going on here as you'd expect from a mobile app. But the problem now is that when someone posts something new, everything shifts down. My scroll position maintains the same, but I'm no longer looking at the same post.
Any ideas how to get this to work?
EDIT:
I seems to me like the most elegant solution would be something like inverting the way we think of scrolling. If we sorted the posts the other way -- oldest at the top, then new posts would end up at the bottom and wouldnt mess up the scrollTop position.
EDIT 2:
I forgot to mention -- I don't know the height of the element I'm inserting. Else I could settle for and ugly brute force method.