Skip to content

Copy knob state URL looses value type #1

@Silic0nS0ldier

Description

@Silic0nS0ldier

Describe the bug
The knobs addon supports copying a URL with existing knob states. Some knobs may use a number as the value, however they are casted to a string when restoring knob state using the copied URL.

To Reproduce
https://github.com/Silic0nS0ldier/storybook-knobs-copy-bug

System

System:
  OS: macOS 10.15.7
  CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
Binaries:
  Node: 12.22.1 - /usr/local/opt/node@12/bin/node
  Yarn: 1.22.10 - /usr/local/bin/yarn
  npm: 6.14.12 - /usr/local/opt/node@12/bin/npm
Browsers:
  Chrome: 90.0.4430.85
  Edge: 90.0.818.49
  Safari: 14.1
npmPackages:
  @storybook/addon-a11y: ^6.1.21 => 6.1.21 
  @storybook/addon-actions: ^6.1.21 => 6.1.21 
  @storybook/addon-knobs: ^6.1.21 => 6.1.21 
  @storybook/addon-viewport: ^6.1.21 => 6.1.21 
  @storybook/addons: ^6.1.21 => 6.1.21 
  @storybook/react: ^6.1.21 => 6.1.21

Additional context
NA

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions