Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URLs to Stories are not Defining Default Args #18256

Closed
luisaugusto opened this issue May 18, 2022 · 2 comments
Closed

URLs to Stories are not Defining Default Args #18256

luisaugusto opened this issue May 18, 2022 · 2 comments

Comments

@luisaugusto
Copy link

Describe the bug
When viewing a story that includes default arg values for the control, when one of the controls is updated, the URL of the story updates to reference the story with the modified control. The default args are not set in the URL however, and are set to !undefined instead, so if you send the link to someone, they will not see the story with the correct controls.

storybookerror.mov

To Reproduce

I can create a repo if needed, but this can be seen in all Storybook deployments, including the ones in the Encyclopedia. For example:

  1. Navigate to The EU Icon Component (https://ec.europa.eu/component-library/playground/ec/?path=/story/components-icon--all)
  2. Notice that the default args for the controls are:
  • name: audio
  • size: medium
  • color: default
  • transformation: none
  1. Change the size control from medium to large. Notice that the URL changes to https://ec.europa.eu/component-library/playground/ec/?path=/story/components-icon--all&args=size:l
  2. Refresh the page and notice that the URL changes to https://ec.europa.eu/component-library/playground/ec/?path=/story/components-icon--all&args=name:!undefined;size:!undefined;color:!undefined;transform:!undefined, and none of the args are set, therefore you cannot send a URL with custom controls set to someone else to view.

System
Occurring in my version of Storybook as well:

  System:
    OS: macOS 12.3.1
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
  Binaries:
    Node: 16.14.2 - ~/.nvm/versions/node/v16.14.2/bin/node
    Yarn: 1.22.18 - ~/.nvm/versions/node/v16.14.2/bin/yarn
    npm: 8.7.0 - ~/.nvm/versions/node/v16.14.2/bin/npm
  Browsers:
    Chrome: 101.0.4951.64
    Firefox: 98.0.2
    Safari: 15.4
  npmPackages:
    @storybook/addon-a11y: ^6.4.19 => 6.4.22 
    @storybook/addon-actions: ^6.4.19 => 6.4.22 
    @storybook/addon-docs: ^6.4.19 => 6.4.22 
    @storybook/addon-essentials: ^6.4.19 => 6.4.22 
    @storybook/addon-links: ^6.4.19 => 6.4.22 
    @storybook/builder-webpack5: ^6.4.19 => 6.4.22 
    @storybook/manager-webpack5: ^6.4.19 => 6.4.22 
    @storybook/preset-scss: ^1.0.3 => 1.0.3 
    @storybook/react: ^6.4.19 => 6.4.22 
    @storybook/testing-react: ^1.2.3 => 1.2.4 

Additional context
N/A

@shilman
Copy link
Member

shilman commented May 19, 2022

Please try upgrading to 6.5. Is it fixed in the latest release?

npx sb upgrade

@luisaugusto
Copy link
Author

Ohhh it's fixed in 6.5, closing this issue.

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

No branches or pull requests

2 participants