storybookjs/storybook

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

クローズ

#26,060 opened on 2024/02/16

 (2 件のコメント) (4 件のリアクション) (0 人の担当者)TypeScript (10,058 件のフォーク)batch import
bughelp wantedsev:S4

Repository metrics

Stars
 (89,909 個のスター)
PR merge metrics
 (平均マージ 7d 22h) (30d で 184 merged PRs)

説明

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

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