diff --git a/src/app/channels/channels.component.ts b/src/app/channels/channels.component.ts index 0bc24a3..791f66e 100644 --- a/src/app/channels/channels.component.ts +++ b/src/app/channels/channels.component.ts @@ -45,7 +45,10 @@ export class ChannelsComponent implements OnInit { } setChannelSelection(channel: Channel): void { - window.location.hash = channel.anchorIdentifier + window.location.hash = channel.anchorIdentifier; + var element = window.document.getElementById(channel.anchorIdentifier); + let element2 = element.getElementsByClassName('mat-expansion-panel-content')[0]; + element2.scrollIntoView({behavior: 'smooth', block: 'start'}); } setChannelSelectionFromLocation(): void { const anchor = window.location.hash; diff --git a/src/app/schemas/schemas.component.ts b/src/app/schemas/schemas.component.ts index f46db1c..33188aa 100644 --- a/src/app/schemas/schemas.component.ts +++ b/src/app/schemas/schemas.component.ts @@ -25,6 +25,9 @@ export class SchemasComponent implements OnInit { setSchemaSelection(schema: Schema): void { window.location.hash = schema.anchorIdentifier + let element = window.document.getElementById(schema.anchorIdentifier); + let element2 = element.getElementsByClassName('mat-expansion-panel-content')[0]; + element2.scrollIntoView({behavior: 'smooth', block: 'start'}); } setSchemaSelectionFromLocation(): void { this.selectedSchema = window.location.hash;