The ion content should have scrolling methods for individual children, no matter how deep they are. Current methods are fine, but one of the goals of the ionic approach is to make time-consuming, boring code like document.getElementById obsolete.
Methods also have no control over scroll animations.
Therefore, currently the best option is the scrollIntoView method. Attach the identifier to the element you want to jump to, then use getElementbyID to call scrollIntoView. So:
.html
... <ion-row id="myElement"> ... </ion-row>
c
... scrollToMyElement() { document.getElementById('myElement').scrollIntoView({ behavior: 'smooth', block: 'center' }); }
Then call the method for some DOM event or button click. If your item is conditional, this most likely will not work. Instead, use a conditional hidden attribute, or if you need to use ngIf , set the logic so that the element is inserted first.
I tried this with various other components of the ion interface (4) and it works great.
source share