Storybook: Mixing of knobs from different stories

Created on 20 Sep 2017  路  4Comments  路  Source: storybookjs/storybook

Description

I have following three stories for SelectMultiple component.

  • Single
  • Multiple
  • Multiple with highlighted element

    And knobs

  • searchable for all stories

  • Highlighted number for last story

When I navigate from last story to first or second
'Highlighted number' knob appears in knobs list.
If i try to change its value the value changes and knob disappears

Code sample

import { withKnobs, boolean, number } from '@storybook/addon-knobs';
const stories = storiesOf('SelectMultiple', module);
stories.addDecorator(withKnobs);

const options = [...];

class SelectContainer extends Component {

  state = {}
  onChange = (value) => {
    this.setState({value});
  }

  render(){
    return 
      <SelectMultiple
        options={options}
        searchable={boolean('searchable', true)}
        value={this.state.value}
        onChange={this.onChange}
        {...this.props}
      />;
  }
}

stories
  .add('Single', () => (<SelectContainer/>))
  .add('Multiple', () => <SelectContainer
    multi
  />)
  .add('Multiple with highlighted element', () => {

    const label = 'Highlighted number';
    const defaultValue = 1;
    const value = number(label, defaultValue);

    return <SelectContainer
      onValueClick={onValueClick}
      multi
      highlighted={value}
    />;
  });
knobs bug inactive

Most helpful comment

Still reproduced on the latest alpha version

All 4 comments

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 60 days. Thanks!

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!

Still reproduced on the latest alpha version

just noticed this happening today, any solutions?

Was this page helpful?
0 / 5 - 0 ratings