1

Whenever I click the scrollMe(target) the entire page also scroll down.

HTML

<div *ngFor="let channel of checkChannelsService.channels">
  <div (click)="scrollMe(target)">
   {{channel.name}}
  </div>
</div>
<div #target *ngFor="let industry of channel.industries">
  {{industry.name}}
</div>

TS

 scrollMe(el) {
   el.scrollIntoView();
 }
Patricio Vargas
  • 5,236
  • 11
  • 49
  • 100
Jong
  • 11
  • 1
  • 1
    Possible duplicate of [ScrollIntoView() causing the whole page to move](https://stackoverflow.com/questions/11039885/scrollintoview-causing-the-whole-page-to-move) – user184994 Sep 29 '18 at 07:45
  • 1
    This is the expected behavior from scrollIntoView(), the page scroll to until the target element is in the viewport – Vash72 Sep 29 '18 at 07:48
  • What should I do so that every time I click an item from the list, it will auto scroll down to that portion of the item? – Jong Sep 30 '18 at 01:47

0 Answers0