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-knob] magic characters block the knob rendering #6526

Closed
leoyli opened this issue Apr 16, 2019 · 5 comments
Closed

[addon-knob] magic characters block the knob rendering #6526

leoyli opened this issue Apr 16, 2019 · 5 comments

Comments

@leoyli
Copy link
Contributor

leoyli commented Apr 16, 2019

Describe the bug

The following story gives a in correct knobs:

To Reproduce

Stept to reproduce:

  1. Add the following fake story:
import React from 'react';
import { storiesOf } from '@storybook/react';
import { boolean as bool, text } from '@storybook/addon-knobs';

const X = () => <div>X</div>;

storiesOf('X', module).add('X', () => {
  return (
    <X
      name="checkbox"
      meta={{
        submitting: bool('meta.submitting', false),
        pristine: bool('meta.pristine', true),
        error: text('meta.error', ''),
      }}
    />
  );
});
  1. see no meta.pristine, meta.error appears; however no errors get printed. 👀

Note: <comething> is potentially be magical, and in some setup it won't be magical (i.e. working as expected...)

Expected behavior
It should show 3 knobs.

Screenshots
N/A

Code snippets
N/A

System:

  • OS: MacOS
  • Device: Macbook Air 2013
  • Browser: ALL
  • Framework: React
  • Addons: Addon-knobs
  • Version: at least since v5.0.2

Additional context
related: #6243.
reproduced by: @Armanio (see here)

@maximeg
Copy link

maximeg commented Aug 11, 2019

Hi @leoyli, the stale bot closed it, but this is still an issue as of @storybook/addon-knobs version 5.1.10:

  const name = text("(props) entry.account.name", "John Doe");
  const screenName = text("(props) entry.account.screenName", "johndoe");
  const title = text("(props) entry.item.title", "The title");

image

Without the dots, that's fine.

@leoyli
Copy link
Contributor Author

leoyli commented Aug 11, 2019

@maximeg, oh thank you to bring this up!

@shilman, I think we need to change the setting on the stale bot do not close the bug tag...

@ndelangen, I was looking a bit but get lost... It seems the root cause is not this addon but the internal lib. I believe the root cause is how storybook serialize the message exchanged via the channel... any idea?!

@leoyli leoyli reopened this Aug 11, 2019
@stale stale bot removed the inactive label Aug 11, 2019
@storybookjs storybookjs deleted a comment from stale bot Aug 11, 2019
@storybookjs storybookjs deleted a comment from stale bot Aug 11, 2019
@storybookjs storybookjs deleted a comment from stale bot Aug 11, 2019
@storybookjs storybookjs deleted a comment from stale bot Aug 11, 2019
@stale
Copy link

stale bot commented Sep 1, 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 1, 2019
@shilman shilman modified the milestones: 5.1.x, 5.2.x Sep 23, 2019
@stale stale bot removed the inactive label Sep 23, 2019
@stale
Copy link

stale bot commented Oct 14, 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 Oct 14, 2019
@stale
Copy link

stale bot commented Nov 13, 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 Nov 13, 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

3 participants