storybookjs / storybook

Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation
https://storybook.js.org
MIT License
84.14k stars 9.25k forks source link

[Bug]: Stories are not overwriting {control: false} from meta (argTypes) #27091

Open DanielFlores-OG opened 4 months ago

DanielFlores-OG commented 4 months ago

Describe the bug

I want to have an argument disabled in most of the stories for a component, but I cannot overwrite the value on meta definition in specific stories.

To Reproduce

Set in meta definition: argTypes{ whatever: {control: false} }; and then try to set argTypes{ whatever: {control: "string"} } inside a story. The control for that arg will remain disabled ("-").

Nonetheless, if you go from control:"string" in meta definition to control: "object" in story, it will overwrite it correctly.

System

System:
    OS: Windows 10 10.0.19045
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
  Binaries:
    Node: 20.11.1 - C:\Program Files\nodejs\node.EXE
    npm: 10.5.2 - ~\Documents\GitHub\design-system\node_modules\.bin\npm.CMD <----- active
  Browsers:
  npmPackages:
    @storybook/addon-a11y: ^8.0.10 => 8.0.10
    @storybook/addon-essentials: ^8.0.10 => 8.0.10
    @storybook/addon-interactions: ^8.0.10 => 8.0.10
    @storybook/addon-themes: ^8.0.10 => 8.0.10
    @storybook/blocks: ^8.0.0-rc.1 => 8.0.10
    @storybook/preview-api: 8.0.10 => 8.0.10
    @storybook/react: ^8.0.10 => 8.0.10
    @storybook/react-vite: ^8.0.10 => 8.0.10
    @storybook/theming: ^8.0.10 => 8.0.10
    chromatic: 11.3.0 => 11.3.0
    eslint-plugin-storybook: 0.8.0 => 0.8.0
    storybook: ^8.0.10 => 8.0.10

Additional context

No response

nishantandewar commented 3 months ago

@DanielFlores-OG Assign it to me, l will work on it.

hakshu25 commented 1 month ago

It hasn't been fixed, so I will work on it.

ShreySinha02 commented 1 month ago

@DanielFlores-OG hii i am able to reproduce this bug Screenshot from 2024-09-02 01-05-39 can you guide me more in this Screenshot from 2024-09-02 01-07-38 Screenshot from 2024-09-02 01-07-32