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

Color picker for addon-controls has a couple issues #17171

Closed
kaiyoma opened this issue Jan 7, 2022 · 3 comments
Closed

Color picker for addon-controls has a couple issues #17171

kaiyoma opened this issue Jan 7, 2022 · 3 comments

Comments

@kaiyoma
Copy link

kaiyoma commented Jan 7, 2022

Describe the bug
Two problems here:

  1. The regex for automatically using the color control doesn't appear to be working correctly.
  2. The color picker doesn't reset if the panel is reset.

To Reproduce
Respectively, from above:

  1. Set an arg named desktopColor to a hex color string and notice that the color picker isn't rendered. You have to set type: 'color' explicitly in argTypes for the picker to appear. The default regex (documented here) should be capturing desktopColor.
  2. Change the value of a color picker, then click the "Reset controls" button in the panel. The color will reset in the rendered component, but the color picker still shows the old value.

System

Environment Info:

  System:
    OS: Windows 10 10.0.19044
    CPU: (4) x64 Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz
  Binaries:
    Node: 16.13.0 - C:\Program Files\Node.js\node.EXE
    npm: 8.1.4 - C:\Program Files\Node.js\npm.CMD
  Browsers:
    Chrome: 96.0.4664.110
    Edge: Spartan (44.19041.1266.0), Chromium (96.0.1054.62)
  npmPackages:
    @storybook/addon-actions: 6.4.9 => 6.4.9
    @storybook/addon-controls: 6.4.9 => 6.4.9
    @storybook/addon-docs: 6.4.9 => 6.4.9
    @storybook/addon-knobs: 6.4.0 => 6.4.0
    @storybook/addons: 6.4.9 => 6.4.9
    @storybook/api: 6.4.9 => 6.4.9
    @storybook/components: 6.4.9 => 6.4.9
    @storybook/core: 6.4.9 => 6.4.9
    @storybook/core-events: 6.4.9 => 6.4.9
    @storybook/react: 6.4.9 => 6.4.9
    @storybook/theming: 6.4.9 => 6.4.9
@kaiyoma
Copy link
Author

kaiyoma commented Jan 10, 2022

BTW, I'm seeing the same issue for numeric inputs: resetting the panel doesn't reset the number input to the original value, but the value being passed to the component is reset.

@mgutbor
Copy link

mgutbor commented Jun 9, 2022

Hi all,

does anyone solved the point 1)???

I have this issue before passing from storybook 6.2.9 to 6.3.0.

Does addon controls changed in this version?

Thanks in advance.

@shilman
Copy link
Member

shilman commented Dec 9, 2022

Boo-yah!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.0-beta.2 containing PR #20049 that references this issue. Upgrade today to the @next NPM tag to try it out!

npx sb upgrade --prerelease

Closing this issue. Please re-open if you think there's still more to do.

@shilman shilman closed this as completed Dec 9, 2022
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

3 participants