storybookjs/storybook

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

Open

#26,060 建立於 2024年2月16日

在 GitHub 查看
 (2 留言) (4 反應) (0 負責人)TypeScript (89,909 star) (10,058 fork)batch import
bughelp wantedsev:S4

描述

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

貢獻者指南

[Bug]: Hot reload on docs page causes scroll to top · storybookjs/storybook#26060 | Good First Issue