Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70757

'duration' param of ScrollTo function of ion-content limits the length of scroll

$
0
0

@jooo13 wrote:

I want to scroll to a specific component in an ion-list using its position that I got using the id of the component, like follow :

//this.idRec is the ID of the component
    let element = document.getElementById(this.idRec);
    let offset = element.offsetTop;

To scroll to that specific component I used the function scrollTo(x , y , duration) of ion-content.

    this.content.scrollTo(0, offset, 800);

Yet, this function isn’t working in all cases and I found its behavior weird.

  • When I set the duration param to 300, it can’t scroll to far items (for example those who are at the 10th position in the list)
  • But when I set the duration param to 800 or 1000, it can scroll to those far items ( those who are at the 10th position in the list) but it also has a limit when scrolling down and it can go further than a specific position.

Can anyone help me and explain to me what the ‘duration’ param does or how this function use it.
Can this param be dynamic ? how ?
Thanks in advance.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70757

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>