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

Angular Knobs changing property name to lower case #2641

Closed
paulparton opened this issue Jan 4, 2018 · 4 comments
Closed

Angular Knobs changing property name to lower case #2641

paulparton opened this issue Jan 4, 2018 · 4 comments

Comments

@paulparton
Copy link

paulparton commented Jan 4, 2018

Issue details

When using knobs in Angular the property names are converted to lower case inside KnobWrapperComponent.knobChanged. This is making it impossible to use a knob on a property with a camel cased name

https://github.com/storybooks/storybook/blob/master/addons/knobs/src/angular/helpers.js#L76

Steps to reproduce

When I console log the the ngOnChanges object for the following, the property name changed is "buttontype" instead of "buttonType"

storiesOf('My Story', module)
  .addDecorator(withKnobs)
  .add('Button types', () => {
    const types = [
      'default',
      'primary',
      'secondary'
    ];
    const label = select('buttonType', types, types[0]);
    return {
      component: ButtonComponent,
      props: {
      }
    };
  })

Please specify which version of Storybook and optionally any affected addons that you're running

"@storybook/addon-knobs": "^3.3.3",
"@storybook/angular": "^3.3.3",
@ndelangen ndelangen added the bug label Jan 4, 2018
@ndelangen
Copy link
Member

Is this behavior seems to not exist in React, I wonder why this was added..

Can you remember why this was added @alterx ?

@alterx
Copy link
Member

alterx commented Jan 4, 2018

It's probably a leftover from the first implementation (problems of having to duplicate code 😢 ), right now I can't think of a justification for this. Will look into it.

@paulparton
Copy link
Author

Awesome! thanks for the fast response guys :)

@Hypnosphi
Copy link
Member

Fix released as 3.3.4

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

4 participants