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

Number Knob throws error when clearing value #2693

Closed
amcdnl opened this issue Jan 8, 2018 · 2 comments
Closed

Number Knob throws error when clearing value #2693

amcdnl opened this issue Jan 8, 2018 · 2 comments

Comments

@amcdnl
Copy link
Member

amcdnl commented Jan 8, 2018

Issue

When using knobs with Angular, when I created a number knob and then removed the value in the ui it throws the following error:

manager.bundle.js:6680 Warning: Received NaN for the `value` attribute. If this is expected, cast the value to a string.
    in input (created by NumberType)
    in NumberType (created by PropField)
    in div (created by PropField)
    in PropField (created by propForm)

from this config:

storiesOf('Stepper', module)
    .add(
        'Basic Stepper',
        withNotes(docs)(() => ({
            component: BasicStepperComponent,
            props: {
                step: number('Step', 0)
            },
            moduleMetadata: {
                imports: [StepperModule]
            }
        }))
    );

Versions

        "@angular/common": "^5.1.3",
        "@angular/compiler": "^5.1.3",
        "@angular/core": "^5.1.3",
        "@angular/platform-browser": "^5.1.3",
        "@angular/platform-browser-dynamic": "^5.1.3",
        "@storybook/addon-actions": "^3.4.0-alpha.0",
        "@storybook/addon-knobs": "^3.4.0-alpha.0",
        "@storybook/addon-links": "^3.4.0-alpha.0",
        "@storybook/addon-notes": "^3.4.0-alpha.0",
        "@storybook/addon-options": "^3.4.0-alpha.0",
        "@storybook/angular": "^3.4.0-alpha.0",
@amcdnl amcdnl changed the title Angular Number Knob throws error when clearing value [Angular] Number Knob throws error when clearing value Jan 15, 2018
@alterx alterx changed the title [Angular] Number Knob throws error when clearing value Number Knob throws error when clearing value Jan 17, 2018
@alterx alterx removed the angular label Jan 17, 2018
@alterx
Copy link
Member

alterx commented Jan 17, 2018

This is a knobs issue not directly related to the Angular implementation. I just tested the cra kitchen sink app and this is also happening. We should fix this in the addon itself.

@Hypnosphi
Copy link
Member

Looks like a duplicate of #2475, closing this one. Feel free to open a PR

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