Skip to content

Commit

Permalink
Merge pull request #22714 from storybookjs/fix/doc-scroll-location-pe…
Browse files Browse the repository at this point in the history
…rsist

Docs: Fix scroll location on docs navigation
  • Loading branch information
ndelangen authored Jun 21, 2023
2 parents 4311d33 + 9f308ad commit a8c1570
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions code/lib/preview-api/src/modules/preview-web/WebView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ export class WebView implements View<HTMLElement> {
this.showMain();
this.showDocs();
this.applyLayout('fullscreen');

document.documentElement.scrollTop = 0;
document.documentElement.scrollLeft = 0;

return this.docsRoot();
}

Expand Down

0 comments on commit a8c1570

Please sign in to comment.