1
0
mirror of https://github.com/yldio/copilot.git synced 2024-11-10 21:30:06 +02:00

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,36 +18,35 @@ const SearchAsync = React.createClass({
});
},
render: function () {
options: function(input, callback) {
setTimeout(function() {
callback(null, {
options: [
{ value: 'one', label: 'One' },
{ value: 'two', label: 'Two' },
{ value: 'three', label: 'Three' },
{ value: 'four', label: 'Four' },
{ value: 'five', label: 'Five' },
{ value: 'six', label: 'Six' },
],
// 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
}, 10000);
});
},
const options = function(input, callback) {
setTimeout(function() {
callback(null, {
options: [
{ value: 'one', label: 'One' },
{ value: 'two', label: 'Two' },
{ value: 'three', label: 'Three' },
{ value: 'four', label: 'Four' },
{ value: 'five', label: 'Five' },
{ value: 'six', label: 'Six' },
],
// 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);
});
}
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"