2

I'm trying to change the scroll position of an ion-scroll element but don't getting.. this is what I have tried:

ts

import { Component, ViewChild, ElementRef } from "@angular/core";

 @ViewChild("scroller", { read: ElementRef })
  private scroller: ElementRef;

html

 <ion-scroll #scroller scrollX="true" style="height: 21px; white-space: nowrap">
  <div>... </div>
 </ion-scroll>

This works

  this.scroller.nativeElement.style.background = "blue";

This doesn't work

  this.scroller.nativeElement.scrollLeft = this.scroller.nativeElement.scrollWidth;
poimsm2
  • 512
  • 1
  • 7
  • 23
  • Did you try solution from the question? https://stackoverflow.com/questions/44099796/how-can-i-use-content-scrollto-for-ion-scroll-in-ionic2 – Sergey Rudenko Aug 15 '18 at 05:35

0 Answers0