This issue may happen because the table rows aren’t fully rendered yet when ngAfterViewInit
runs.
A quick test to confirm is wrapping your scroll call in a setTimeout
ngAfterViewInit() {
if (this.initialRowId) {
setTimeout(() => this.scrollToRow(this.initialRowId));
}
}