I have a div with inside some phrase example:
<div class="container">
<div class="phrase-doc">Lorem ipsum bla bla</div>
<div class="phrase-doc">Lorem ipsum bla bla</div>
<div class="phrase-doc">Lorem ipsum bla bla</div>
<div class="phrase-doc active">Lorem ipsum bla bla</div>
<div class="phrase-doc">Lorem ipsum bla bla</div>
<div class="phrase-doc">Lorem ipsum bla bla</div>
<div class="phrase-doc">Lorem ipsum bla bla</div>
</div>
<button class="btn">Move</button>
when i click on the button i want move the scroll on the active phrase, i use this code
this.el.nativeElement.querySelector('.phrase-doc.active').scrollIntoView();
and work good only if the container it's visible on the page, but if the container it's not visible, the page scroll move on it, i want the page scroll stay in the same position and only the scroll inside container move on the active phrase and the container should not scroll into view if it is not visible.