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

addon-knobs | Select | Knobs after select disappear when you pass to select an object with empty string key as options #7763

Closed
nekitk opened this issue Aug 13, 2019 · 2 comments

Comments

@nekitk
Copy link
Member

nekitk commented Aug 13, 2019

Describe the bug
When you pass to select's options an object with an empty string as a key select itself renders and works properly, but all the knobs after the select fail to render.

Using 0, null or undefined as a key doesn't affect rendering, only empty string.

To Reproduce
Steps to reproduce the behavior:

  1. Edit examples/official-storybook/stories/addon-knobs.stories.js
  2. Add '': '', option to fruits
  3. Open storybook
  4. Knobs after select doesn't appear (see screenshot below)

Expected behavior
All knobs should be rendered

Screenshots

Code snippets

const fruits = {
  '': '',
  Apple: 'apple',
  Banana: 'banana',
  Cherry: 'cherry',
};
const fruit = select('Fruit', fruits, 'apple');

System:

Environment Info:

  System:
    OS: macOS High Sierra 10.13.6
    CPU: (4) x64 Intel(R) Core(TM) i3-4370 CPU @ 3.80GHz
  Binaries:
    Node: 10.16.0 - /usr/local/bin/node
    Yarn: 1.17.3 - ~/.yarn/bin/yarn
    npm: 6.10.2 - /usr/local/bin/npm
  Browsers:
    Chrome: 76.0.3809.100
    Firefox: 55.0.3
    Safari: 12.1.2

Additional context
Discovered in storybook-eol/addon-smart-knobs#59

@stale
Copy link

stale bot commented Sep 3, 2019

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale stale bot added the inactive label Sep 3, 2019
@stale
Copy link

stale bot commented Oct 3, 2019

Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook!

@stale stale bot closed this as completed Oct 3, 2019
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

2 participants