Skip to content

[Bug]: hash navigation does not work #29361

Closed
@KhaledSakr

Description

Describe the bug

If you click on the anchor tag next to a story title in the autodocs page, it adds a hash parameter to the page url. However, this hash parameter cannot be used again to go to the same story.

Reproduction link

https://stackblitz.com/github/storybookjs/sandboxes/tree/next/react-webpack/18-ts/after-storybook?file=.storybook%2Fpreview.ts

Reproduction steps

  1. Open the reproduction link
  2. Open preview in a new tab
  3. Visit /?path=/docs/example-button--docs#secondary
  4. See that it doesn't go directly to the Secondary story

System

Storybook Environment Info:

System:
OS: Linux 5.0 undefined
CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Shell: 1.0 - /bin/jsh
Binaries:
Node: 18.20.3 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.2.3 - /usr/local/bin/npm <----- active
pnpm: 8.15.6 - /usr/local/bin/pnpm
npmPackages:
@storybook/addon-essentials: ^8.4.0-alpha.7 => 8.4.0-alpha.7
@storybook/addon-interactions: ^8.4.0-alpha.7 => 8.4.0-alpha.7
@storybook/addon-onboarding: ^8.4.0-alpha.7 => 8.4.0-alpha.7
@storybook/addon-webpack5-compiler-swc: ^1.0.5 => 1.0.5
@storybook/blocks: ^8.4.0-alpha.7 => 8.4.0-alpha.7
@storybook/react: ^8.4.0-alpha.7 => 8.4.0-alpha.7
@storybook/react-webpack5: ^8.4.0-alpha.7 => 8.4.0-alpha.7
@storybook/test: ^8.4.0-alpha.7 => 8.4.0-alpha.7
storybook: ^8.4.0-alpha.7 => 8.4.0-alpha.7

Additional context

I just used a brand new react 18/webpack5 storybook via storybook.new. No configuration changes were made.

Activity

Sidnioulz

Sidnioulz commented on Dec 24, 2024

@Sidnioulz
Member

Can repro. Fixed by #30130.

@KhaledSakr it would be lovely if you could please test the linked branch and let us know if it fixes the issue as you expected.

self-assigned this
on Dec 24, 2024
KhaledSakr

KhaledSakr commented on Dec 24, 2024

@KhaledSakr
Author

Can repro. Fixed by #30130.

@KhaledSakr it would be lovely if you could please test the linked branch and let us know if it fixes the issue as you expected.

Hi Steve, thanks for the effort! I can verify that the linked branch fixes the issue.

Sidnioulz

Sidnioulz commented on Dec 24, 2024

@Sidnioulz
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    [Bug]: hash navigation does not work · Issue #29361 · storybookjs/storybook