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: Add option to disable "save from controls" #28377

Closed
shilman opened this issue Jun 28, 2024 Discussed in #27219 · 5 comments · Fixed by #28734
Closed

Controls: Add option to disable "save from controls" #28377

shilman opened this issue Jun 28, 2024 Discussed in #27219 · 5 comments · Fixed by #28734

Comments

@shilman
Copy link
Member

shilman commented Jun 28, 2024

Discussed in #27219

Originally posted by MichaelAllenWarner May 22, 2024

Summary

The new feature for creating and editing stories from controls is great, but with my (idiosyncratic) setup it doesn't work, and I'd like to disable it since it just gets in the way. Is there a way to prevent that "You modified this story..." popup from appearing altogether when I use the Controls?

Additional information

No response

Create a reproduction

No response

@shilman shilman changed the title Controls: Add option to disable "Creating and editing stories from controls" feature Controls: Add option to disable "Creating and editing stories from controls" Jun 28, 2024
@shilman
Copy link
Member Author

shilman commented Jun 28, 2024

Proposal:

// .storybook/preview.js
export default {
  parameters: {
    controls: {
      disableSave: true
    }
  }
}

@ghengeveld
Copy link
Member

ghengeveld commented Jun 28, 2024

Alternate proposal:

// .storybook/main.js
export default {
  addons: [
    {
      name: "@storybook/addon-essentials",
      options: {
        saveFromControls: false
      },
    },
  ],
};

Or when using addon-controls directly:

// .storybook/main.js
export default {
  addons: [
    {
      name: "@storybook/addon-controls",
      options: {
        saveFromControls: false
      },
    },
  ],
};

@shilman shilman moved this to Empathy Backlog in Core Team Projects Jun 29, 2024
@shilman shilman changed the title Controls: Add option to disable "Creating and editing stories from controls" Controls: Add option to disable "save from controls" Jun 29, 2024
@woutervanvliet
Copy link

Would very much like to see this get implemented

@cijokb
Copy link

cijokb commented Jul 22, 2024

Any update on this ?

@kartik1112
Copy link

Can I start to work on this ?

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

Successfully merging a pull request may close this issue.

7 participants