storybookjs/storybook
在 GitHub 查看Scroll position does not reset when switching between long docs
Open
#12,497 创建于 2020年9月16日
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:
- Create at least two MDX docs without stories, with content long enough to result in a scroll bar.
- Select the first doc in the sidebar.
- Scroll down the first document.
- 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

Code snippets https://github.com/zolk/storybook-mdx-scroll-bug
System: Reproducible in Storybook 6.0.21.