storybookjs/storybook

[Bug]: Hot reload on docs page causes scroll to top

已关闭

#26,060 创建于 2024年2月16日

 (2 条评论) (4 个反应) (0 位负责人)TypeScript (10,058 个派生)batch import
bughelp wantedsev:S4

仓库指标

星标
 (89,909 个星标)
PR 合并指标
 (平均合并 7天 22小时) (30 天内合并 184 个 PR)

描述

Describe the bug

When applying a hot-reload/fast-refresh while scrolled down and looking at the docs page, the page scrolls back to the top

This is quite annoying if you're using the docs page to see multiple stories at once while working on them

To Reproduce

I've reproduced this using the sandboxes for 7.6.16 and 8.0.0-beta.2 with no modifications after running npx sb sandbox.

System

Storybook Environment Info:

  System:
    OS: macOS 14.3
    CPU: (8) x64 Intel(R) Core(TM) i7-1068NG7 CPU @ 2.30GHz
    Shell: 5.1.8 - /usr/local/bin/bash
  Binaries:
    Node: 18.8.0 - ~/.asdf/installs/nodejs/18.8.0/bin/node
    Yarn: 1.22.21 - ~/.asdf/installs/nodejs/18.8.0/bin/yarn
    npm: 8.18.0 - ~/.asdf/installs/nodejs/18.8.0/bin/npm <----- active
    pnpm: 8.11.0 - ~/.asdf/installs/nodejs/18.8.0/bin/pnpm
  Browsers:
    Chrome: 121.0.6167.184
    Edge: 121.0.2277.128
    Safari: 17.3
  npmPackages:
    @storybook/addon-essentials: ^8.0.0-beta.2 => 8.0.0-beta.2
    @storybook/addon-interactions: ^8.0.0-beta.2 => 8.0.0-beta.2
    @storybook/addon-links: ^8.0.0-beta.2 => 8.0.0-beta.2
    @storybook/addon-onboarding: ^1.0.11 => 1.0.11
    @storybook/blocks: ^8.0.0-beta.2 => 8.0.0-beta.2
    @storybook/preset-create-react-app: ^8.0.0-beta.2 => 8.0.0-beta.2
    @storybook/react: ^8.0.0-beta.2 => 8.0.0-beta.2
    @storybook/react-webpack5: ^8.0.0-beta.2 => 8.0.0-beta.2
    @storybook/test: ^8.0.0-beta.2 => 8.0.0-beta.2
    storybook: ^8.0.0-beta.2 => 8.0.0-beta.2

Additional context

No response

贡献者指南