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

Open
shilman opened this issue Jun 28, 2024 Discussed in #27219 · 2 comments
Open

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

shilman opened this issue Jun 28, 2024 Discussed in #27219 · 2 comments

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 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Empathy Backlog
Development

No branches or pull requests

2 participants