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

Controls: Fix undefined args handling in the URL #18135

Merged
merged 3 commits into from May 5, 2022
Merged

Controls: Fix undefined args handling in the URL #18135

merged 3 commits into from May 5, 2022

Conversation

evont
Copy link

@evont evont commented May 4, 2022

Issue: #17063

What I did

Fix a bug where args were erroneously getting set to undefined when they weren't present in the URL and the page was reloaded.

How to test

cd examples/official-storybook
yarn storybook
  1. Open the new story in this PR
  2. Change one of the args via controls, observe that the new value gets added to the URL
  3. Reload the browser, observe that the new value from step 2 gets restored to that arg.
  4. Also observe that the other args remain unchanged. If you perform these steps in next, you'll see that the other args get erroneously set to undefined in both the URL and the args.

@nx-cloud
Copy link

nx-cloud bot commented May 4, 2022

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 1ab2149. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

@evont evont mentioned this pull request May 4, 2022
3 tasks
@shilman shilman changed the title Fix avoid undefined args Controls: Fix undefined args handling May 5, 2022
Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fix @evont @tmeasday. Merging!

@shilman shilman merged commit 973d335 into storybookjs:next May 5, 2022
@shilman shilman changed the title Controls: Fix undefined args handling Controls: Fix undefined args handling in the URL May 5, 2022
@zecka
Copy link

zecka commented May 10, 2022

Any chance to add this fix in a revision of 6.4 instead of 6.5 ?

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

Successfully merging this pull request may close these issues.

None yet

4 participants