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

[5.0.0] Error message when removing value from number knob #5912

Closed
web-padawan opened this issue Mar 6, 2019 · 6 comments
Closed

[5.0.0] Error message when removing value from number knob #5912

web-padawan opened this issue Mar 6, 2019 · 6 comments

Comments

@web-padawan
Copy link
Contributor

Describe the bug
When removing the value from the "number" knob, following error appears in the console:

Full log
Warning: `value` prop on `input` should not be null. Consider using an empty string to clear the component or `undefined` for uncontrolled components.
    in input (created by Context.Consumer)
    in Input (created by NumberType)
    in NumberType (created by PropForm)
    in label (created by Context.Consumer)
    in Styled(label) (created by Field)
    in Field (created by PropForm)
    in form (created by Context.Consumer)
    in Styled(form) (created by PropForm)
    in PropForm (created by KnobPanel)
    in div (created by Context.Consumer)
    in Styled(div) (created by KnobPanel)
    in KnobPanel
    in div (created by Context.Consumer)
    in Styled(div)
    in div (created by Context.Consumer)
    in Styled(div)
    in Unknown
    in Unknown
    in Unknown
    in Unknown (created by Context.Consumer)
    in _default (created by Layout)
    in div (created by Context.Consumer)
    in Styled(div) (created by Panel)
    in Panel (created by Layout)
    in div (created by Context.Consumer)
    in Styled(div) (created by Main)
    in div (created by Context.Consumer)
    in Styled(div) (created by Main)
    in Main (created by Layout)
    in Layout (created by Context.Consumer)
    in WithTheme(Layout) (created by ResizeDetector)
    in ResizeDetector
    in div (created by Context.Consumer)
    in Styled(div)
    in Unknown
    in Unknown (created by ResizeDetector)
    in ResizeDetector
    in Unknown
    in Unknown (created by Manager)
    in ThemeProvider (created by Manager)
    in Manager (created by Context.Consumer)
    in Location (created by QueryLocation)
    in QueryLocation (created by Root)
    in LocationProvider (created by Root)
    in HelmetProvider (created by Root)
    in Root
Warning: A component is changing a controlled input of type number to be uncontrolled. Input elements should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://fb.me/react-controlled-components
    in input (created by Context.Consumer)
    in Input (created by NumberType)
    in NumberType (created by PropForm)
    in label (created by Context.Consumer)
    in Styled(label) (created by Field)
    in Field (created by PropForm)
    in form (created by Context.Consumer)
    in Styled(form) (created by PropForm)
    in PropForm (created by KnobPanel)
    in div (created by Context.Consumer)
    in Styled(div) (created by KnobPanel)
    in KnobPanel
    in div (created by Context.Consumer)
    in Styled(div)
    in div (created by Context.Consumer)
    in Styled(div)
    in Unknown
    in Unknown
    in Unknown
    in Unknown (created by Context.Consumer)
    in _default (created by Layout)
    in div (created by Context.Consumer)
    in Styled(div) (created by Panel)
    in Panel (created by Layout)
    in div (created by Context.Consumer)
    in Styled(div) (created by Main)
    in div (created by Context.Consumer)
    in Styled(div) (created by Main)
    in Main (created by Layout)
    in Layout (created by Context.Consumer)
    in WithTheme(Layout) (created by ResizeDetector)
    in ResizeDetector
    in div (created by Context.Consumer)
    in Styled(div)
    in Unknown
    in Unknown (created by ResizeDetector)
    in ResizeDetector
    in Unknown
    in Unknown (created by Manager)
    in ThemeProvider (created by Manager)
    in Manager (created by Context.Consumer)
    in Location (created by QueryLocation)
    in QueryLocation (created by Root)
    in LocationProvider (created by Root)
    in HelmetProvider (created by Root)
    in Root

To Reproduce
Steps to reproduce the behavior:

  1. Add number knov
  2. Remove the value
  3. See error in the console

Expected behavior
No error in the console.

Screenshots
number-error

System:

  • OS: Mac OS
  • Device: Macbook Pro 2017
  • Browser: Chrome, Safari, Firefox
  • Framework: Polymer
  • Addons: knobs
  • Version: 5.0.0

Additional context
Seems like the same as #2475 which was previously fixed, could be a regression.

@IshaTr
Copy link

IshaTr commented Mar 12, 2019

@web-padawan @shilman Hey do you mind if I take this issue up?

@shilman
Copy link
Member

shilman commented Mar 12, 2019

@IshaTr Go for it! 👍

@toshi1127
Copy link
Contributor

@IshaTr
@shilman
I'm sorry if you put your hand on
I tried to fix it.

@IshaTr
Copy link

IshaTr commented Mar 12, 2019

@toshi1127 are you done with the fix?

@toshi1127
Copy link
Contributor

@IshaTr
I fixed it, so I opened PR!

@shilman
Copy link
Member

shilman commented Mar 12, 2019

Great Caesar's ghost!! I just released https://github.com/storybooks/storybook/releases/tag/v5.1.0-alpha.5 containing PR #6043 that references this issue. Upgrade today to try it out!

Because it's a pre-release you can find it on the @next NPM tag.

Closing this issue. Please re-open if you think there's still more to do.

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