storybook [Bug]: 工具栏中的全局变量显示为已选中,即使默认值已被选中,

63lcw9qa  于 5个月前  发布在  其他
关注(0)|答案(1)|浏览(45)

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*
dgsult0t

dgsult0t1#

我同意你的观点@JoshTumath,我没有检查附加组件的代码来查看差异,但例如在视口附加组件中并不存在这个问题。

相关问题