Storybook: Storybook 6.0: viewport not being set on initial load

Created on 15 Jul 2020  路  8Comments  路  Source: storybookjs/storybook

Describe the bug
Viewport is not set on. the story on initial load:

https://next--storybookjs.netlify.app/official-storybook/?path=/story/addons-viewport-custom-default-kindle-fire-2--overridden-via-with-viewport-parameterized-decorator

To Reproduce
Steps to reproduce the behavior:

  1. Go to link
  2. see the viewport not being set

Expected behavior
I expect viewport addon to set proper viewport

Screenshots
Screen Shot 2020-07-14 at 7 32 18 PM
Screen Shot 2020-07-14 at 7 32 28 PM

Code snippets

  viewport: {
    viewports: {
      mobile: {
        name: 'Mobile',
        styles: {
          width: '360px',
          height: '640px',
        },
        type: 'mobile',
      },
    },
    defaultViewport: 'mobile',
  },

System:
Please paste the results of npx -p @storybook/cli@next sb info here.

Additional context
Add any other context about the problem here.

P1 viewport bug todo tracked

Most helpful comment

隆Ay Caramba!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.1.0-alpha.24 containing PR #11627 that references this issue. Upgrade today to the @next NPM tag to try it out!

npx sb upgrade --prerelease

Closing this issue. Please re-open if you think there's still more to do.

All 8 comments

Confirmed that this is a regression 6.0. Here's the 5.3 version https://storybookjs.netlify.app/official-storybook/?path=/story/addons-viewport-custom-default-kindle-fire-2--overridden-via-with-viewport-parameterized-decorator

I'm on it

nope, still open 鈽濓笍

Sometimes the initialization of the viewport works, some times it doesn't.

What is reproducible for me is, that calling the storybook root path switches to the configured default path ('iphone6'), but reloading on a specific component (or entering the URL of a specific component) defaults to 'responsive'.

Example

Works: https://www.egonoid.com/storybook/
Doesn't work: https://www.egonoid.com/storybook/?path=/story/components-content-bio--default

Any update/projected release or ETA on this by chance? (not rushing, just asking for planning purposes)

@agrohs We have a supposedly working PR for this. @ndelangen WDYT about merging that given that we're probably not going to implement the globals-based version any time soon?

yeah, should be good

隆Ay Caramba!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.1.0-alpha.24 containing PR #11627 that references this issue. Upgrade today to the @next NPM tag to try it out!

npx sb upgrade --prerelease

Closing this issue. Please re-open if you think there's still more to do.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tomitrescak picture tomitrescak  路  3Comments

sakulstra picture sakulstra  路  3Comments

rpersaud picture rpersaud  路  3Comments

dnlsandiego picture dnlsandiego  路  3Comments

tlrobinson picture tlrobinson  路  3Comments