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 object control for story switching #11432

Merged
merged 1 commit into from
Jul 6, 2020
Merged

Conversation

shilman
Copy link
Member

@shilman shilman commented Jul 6, 2020

Issue: Object editor control wasn't updated properly on story switching

What I did

The object control uses internal state for JSON validation, but doesn't update that state when the externally passed values change.

  • Added a minimal repro to official-storybook
  • Added a useEffect to update the state when needed

How to test

Try official-storybook Controls stories with and without change

@shilman shilman added this to the 6.0 args milestone Jul 6, 2020
@shilman shilman changed the title Controls: Fix object story switching Controls: Fix object control for story switching Jul 6, 2020
Copy link
Member

@yannbf yannbf left a comment

Choose a reason for hiding this comment

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

LGTM!

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.

2 participants