storybookjs/storybook

Scroll position does not reset when switching between long docs

Open

#12,497 opened on 2020年9月16日

GitHub で見る
 (11 comments) (2 reactions) (1 assignee)TypeScript (89,909 stars) (10,058 forks)batch import
addon: docsbuggood first issuehelp wantedtriage:reviewed

説明

Describe the bug With multiple pure-documentation MDX docs, the scroll position of the preview window does not reset when switching between docs.

To Reproduce Steps to reproduce the behavior:

  1. Create at least two MDX docs without stories, with content long enough to result in a scroll bar.
  2. Select the first doc in the sidebar.
  3. Scroll down the first document.
  4. Select the second doc in the sidebar.

The second doc loads with the scroll position already partially down the page.

Expected behavior Selecting a doc should always start with the scroll position at the top of the page.

Screenshots Screen Recording 2020-09-16 at 14 57 46

Code snippets https://github.com/zolk/storybook-mdx-scroll-bug

System: Reproducible in Storybook 6.0.21.

コントリビューターガイド

Scroll position does not reset when switching between long docs · storybookjs/storybook#12497 | Good First Issue