Ion-list auto scrollToTop?


#1

Hey guys,

ive experienced a strange behaviour while using ion-list, especially in combination with the side menu.
When clicking the header element, my list is automatically scrolling to the top. Even if i click a button in my header…this is really awkward, because it is also happening when im opening the side menu :frowning:.

The other thing is, that the list is also scrolling automatically up when i change the view. Is this really wanted or just a bug? If this behaviour is wanted, is it somehow possible to prevent the list from doing this? I always thought that ionic is caching every view?

Thanks in advance!

Cheers,
Antony


#2

look in the documentations:
http://ionicframework.com/docs/api/directive/ionHeaderBar/
and
http://ionicframework.com/docs/api/directive/ionNavBar/

there is an attribute no-tap-scroll


#3

You (and me) may be hitting a bug.

If you google “chrome bug scroll top” you will see several reports.

In my case, whenever I clicked an list-item, the list would scrollTop, but only on crosswalk12 (chrome 40) and not on my desktop browser (Chrome 43.0)

Since I am not clicking navBar or Header, I think it is a bug, or, events are bubbling .

Still investigation…
@thinklabs: Do you have any feedback on this?

— Update ------
I’ve hooked a on-scroll callback on just to see what was happening and looked like inside ionic.js ‘top’ and ‘left’ were always been passed as zero.

I’ve updated from ionic 1.0.1 to ionic 1.1.0 and the problem disapeared !


#4

Hey, thanks for your update!
I was facing the same issue some days ago, but there were some higher priorised issues. Anyways good to know that you’ve found a solution for that.