diff --git a/examples/src/app.js b/examples/src/app.js index ed588679f0..5123bbde78 100644 --- a/examples/src/app.js +++ b/examples/src/app.js @@ -10,6 +10,7 @@ import CustomRender from './components/CustomRender'; import Multiselect from './components/Multiselect'; import NumericSelect from './components/NumericSelect'; import States from './components/States'; +import AllowCreate from './components/AllowCreate'; ReactDOM.render(
@@ -19,9 +20,7 @@ ReactDOM.render( - {/* - - */} +
, document.getElementById('example') ); diff --git a/examples/src/components/AllowCreate.js b/examples/src/components/AllowCreate.js new file mode 100644 index 0000000000..161d09dd44 --- /dev/null +++ b/examples/src/components/AllowCreate.js @@ -0,0 +1,61 @@ +import React from 'react'; +import Select from 'react-select'; + +const FLAVOURS = [ + { label: 'Chocolate', value: 'chocolate' }, + { label: 'Vanilla', value: 'vanilla' }, + { label: 'Strawberry', value: 'strawberry' }, + { label: 'Caramel', value: 'caramel' }, + { label: 'Cookies and Cream', value: 'cookiescream' }, + { label: 'Peppermint', value: 'peppermint' }, +]; + +var AllowCreate = React.createClass({ + displayName: 'AllowCreate', + + propTypes: { + allowCreate: React.PropTypes.bool, + label: React.PropTypes.string, + }, + + getInitialState () { + return { + disabled: false, + crazy: false, + options: FLAVOURS, + value: [], + }; + }, + + onLabelClick (data, event) { + console.log(data, event); + }, + + handleSelectChange (value){ + this.setState({ value }); + }, + + renderHint () { + return ( +
Create options in tag mode
+ ); + }, + + render () { + return ( +
+

{this.props.label}

+