diff --git a/examples/async-data/app.js b/examples/async-data/app.js index 05a149ed..2742d87b 100644 --- a/examples/async-data/app.js +++ b/examples/async-data/app.js @@ -16,17 +16,15 @@ let App = React.createClass({ return (

Async Data

-

Autocomplete works great with async data by allowing you to pass in items. The onChange event provides you the value to make a server request with, then change state and pass in new items, it will attempt to autocomplete the first one.

- + + item.name} onSelect={value => this.setState({ value, unitedStates: [] }) } diff --git a/examples/static-data/app.js b/examples/static-data/app.js index e3022f2e..932798e4 100644 --- a/examples/static-data/app.js +++ b/examples/static-data/app.js @@ -10,16 +10,14 @@ let App = React.createClass({ return (

Basic Example with Static Data

-

When using static data, you use the client to sort and filter the items, so Autocomplete has methods baked in to help.

- + item.name} shouldItemRender={matchStateToTerm} diff --git a/lib/Autocomplete.js b/lib/Autocomplete.js index fd25a96d..6d5e9eb0 100644 --- a/lib/Autocomplete.js +++ b/lib/Autocomplete.js @@ -1,5 +1,4 @@ const React = require('react') -const lodash = require('lodash') const scrollIntoView = require('dom-scroll-into-view') let _debugStates = [] @@ -14,7 +13,6 @@ let Autocomplete = React.createClass({ renderItem: React.PropTypes.func.isRequired, menuStyle: React.PropTypes.object, inputProps: React.PropTypes.object, - labelText: React.PropTypes.string, wrapperProps: React.PropTypes.object, wrapperStyle: React.PropTypes.object }, @@ -27,7 +25,6 @@ let Autocomplete = React.createClass({ display: 'inline-block' }, inputProps: {}, - labelText: '', onChange () {}, onSelect (value, item) {}, renderMenu (items, value, style) { @@ -55,7 +52,6 @@ let Autocomplete = React.createClass({ }, componentWillMount () { - this.id = lodash.uniqueId('autocomplete-'); this._ignoreBlur = false this._performAutoCompleteOnUpdate = false this._performAutoCompleteOnKeyUp = false @@ -313,11 +309,9 @@ let Autocomplete = React.createClass({ state: this.state }) } + return (
- this.handleKeyUp(event)} onClick={this.handleInputClick} value={this.props.value} - id={this.id} /> {this.state.isOpen && this.renderMenu()} {this.props.debug && ( diff --git a/package.json b/package.json index f5cf21b0..38a551a2 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,6 @@ "dependencies": { "babel-preset-es2015": "^6.5.0", "dom-scroll-into-view": "1.0.1", - "lodash": "^4.5.0", "react": "^0.14.7", "react-dom": "^0.14.7" }