I've got a form modal that pops up and has 4 sections to complete. Each section has a next button. I would like the next button to trigger a scrollTo(0) function, but I cannot seem to get a working solution. The last thing I have tried is a variation of window.scrollTo(), but it keeps scrolling the whole page to the top, not the modal.
Any thoughts?
Here is my .ts file
import {WindowRef} from './window-ref';
...
constructor(private winRef: WindowRef) { }
...
toggleInfo(){
this.infoState = this.infoState === 'active' ? 'inactive' : 'active';
this.toggleInsurance()
this.winRef.nativeWindow.scrollTo(0)
}
//winRef gives me access to the window object
Any ideas?