changing setTimeout length

This commit is contained in:
Alex Windett 2017-01-06 10:56:19 +00:00
parent bdc7af27de
commit 8d500cd8d3
2 changed files with 23 additions and 27 deletions

View File

@ -1,10 +1,6 @@
const React = require('react');
const Select = require('react-select');
const {
Async
} = Select
const SelectAsync = Async
const SelectAsync = Select.Async
const SearchAsync = React.createClass({
@ -22,9 +18,7 @@ const SearchAsync = React.createClass({
});
},
render: function () {
const options = function(input, callback) {
options: function(input, callback) {
setTimeout(function() {
callback(null, {
options: [
@ -38,20 +32,21 @@ const SearchAsync = React.createClass({
// CAREFUL! Only set this to true when there are no more options,
// or more specific queries will not be sent to the server.
complete: true
}, 1000);
}, 10000);
});
}
},
render: function () {
return (
<div>
<h1> Async Search </h1>
<SelectAsync
ref="stateSelect"
loadOptions={options}
ref="stateSelectAsync"
loadOptions={this.options}
value={this.state.selectValue}
isLoading={true}
onChange={this.updateValue}
multi={this.props.multi}
multi={true}
/>
</div>
)

View File

@ -33,6 +33,7 @@ const Search = React.createClass({
<h1> {this.props.multi ? 'Multi' : 'Single'} Search </h1>
<Select
ref="stateSelect"
className="is-open"
autofocus
options={options}
name="selected-state"