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

[Bug]: Globals in Toolbar show as selected even when default value is selected #20009

Open
JoshTumath opened this issue Nov 29, 2022 · 1 comment

Comments

@JoshTumath
Copy link

Describe the bug

When a button is in the toolbar (such as the vision simulator), it appears with a transparent background by default and blue when something is selected.

However, when making a Global, all of the options appear blue when selected - even the default value. You would expect that when the default value is selected, the button would be marked as transparent/unselected.

To Reproduce

Add the following to the `preview.js`:


// .storybook/preview.js

export const globalTypes = {
  theme: {
    name: 'Theme',
    description: 'Global theme for components',
    defaultValue: 'light',
    toolbar: {
      icon: 'circlehollow',
      items: ['light', 'dark'],
      showName: true,
      dynamicTitle: true,
    },
  },
};


Run storybook.

You will see the 'Theme' button appears with a blue background in the toolbar.

System

No response

Additional context

No response

@sneko
Copy link

sneko commented Jan 24, 2023

I agree with you @JoshTumath , I didn't check the addons code to see the difference but this does not exist on the viewport addon for example...

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

4 participants