react-select bug report

react-select bug report template (with JSX and ES6)

by Robert Maloney

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.13.1/JSXTransformer.js"></script>
<script src="https://unpkg.com/react@15.0.0/dist/react-with-addons.js"></script>
<script src="https://unpkg.com/react-dom@15.0.0/dist/react-dom.js"></script>
<script src="https://npmcdn.com/react-input-autosize/dist/react-input-autosize.js"></script>
<script src="https://npmcdn.com/classnames/index.js"></script>
<script src="https://npmcdn.com/react-select/dist/react-select.js"></script>
<link rel="stylesheet" href="https://npmcdn.com/react-select/dist/react-select.css">
<script src="https://facebook.github.io/react/js/jsfiddle-integration.js"></script>

Your example code will be loaded below:
<div id="container">
  <!-- This element's contents will be replaced with your component. -->
</div>

JavaScript 1.7

// Customize the below code to show your bug :)

const options = [
  { value: 'one', label: 'One' },
  { value: 'two', label: 'Two' }
];

const initialValue = 'one';

class Example extends React.Component {
  constructor(props) {
    super();
    this.state = {
      value: props.initialValue,
    };
    
    this.logChange = this.logChange.bind(this);
  }
  
  logChange(newVal) {
    console.log('Selected: ', newVal);
    this.setState({ value: newVal });
  }
  
  render() {
    return (
      <Select
        value={this.state.value}
        options={this.props.options}
        onChange={this.logChange}
      />
    );
  }
}

ReactDOM.render(
  <Example
    initialValue={initialValue}
    options={options}
  />,
  document.getElementById('container')
);