storybook: [Bug]: Storybook 7.2.1: When I click on the canvas navlink in mobile view the selected sidebar story is not shown

Describe the bug

When I click on any story below the first/top one in the sidebar in mobile view (using Firefox v115.0.3) the story is at first correctly displayed to the right (scaled down but I can see that it’s the selected story) but as soon as I click on the canvas navlink the story that is shown on the canvas is not the selected story but instead the first/top story in the sidebar.

I doesn’t matter which story I choose/select, as soon as I click on the canvas navlink the story “resets” to the first/top one and that is what is displayed on the canvas.

I was previously using storybook 7.0.20 and everything was working fine. I used “yarn dlx storybook@latest upgrade” to upgrade from 7.0.20 to 7.2.1 and I’m using a mono repo (lerna).


Example/repro:

  1. Select a story in Sidebar view (page is shown in mobile view) bild

  2. Click on Canvas navlink expecting to see the selected story but instead the story gets “reset” to the first/top one in the sidebar bild

To Reproduce

No response

System

Environment Info:

  System:
    OS: Windows 10 10.0.22621
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
  Binaries:
    Node: 16.20.0 - ~\AppData\Local\Volta\tools\image\node\16.20.0\node.EXE
    Yarn: 4.0.0-rc.42 - ~\AppData\Local\Volta\tools\image\yarn\4.0.0-rc.42\bin\yarn.CMD
    npm: 8.19.4 - ~\AppData\Local\Volta\tools\image\node\16.20.0\npm.CMD
  Browsers:
    Edge: Spartan (44.22621.1992.0), Chromium (114.0.1823.43)

Additional context

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 21
  • Comments: 15 (5 by maintainers)

Most upvoted comments

I can confirm this is still present in Storybook 7.4.0

@marcomontalbano It should indeed fix the problem since in the new 8.0 version we are not touching the size of the preview. We are simply adding navigation items on top of the preview.

Any update on this?? This issue is a blocker for our QA team.

This has been fixed with the revamped mobile UI, that is scheduled for 8.0.

I’ll let @shilman decide if he wants to keep this open in an attempt at fixing it in 7.x as well, or if we should just close it now.