File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,7 @@ export default withKeyboardAwareScrollView(HomeScreen);
113113 highlightText | Highlight search results | Boolean | true
114114 rightContent | Render additional text to the right of the item | Boolean | false
115115 minimumCharactersCount | Perform API request after certain number of characters entered | Number | 2
116+ waitInterval | Timeout between user finished typing and new data fetch | Number | 400
116117 placeholder | Autocomplete input placeholder text | String | Add Item
117118 placeholderColor | Input placeholder color | String | #acada9
118119 spinnerSize | Size of activity indicator | String | small
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ class Autocomplete extends Component {
2929 }
3030
3131 handleInputChange ( text ) {
32- const { minimumCharactersCount} = this . props ;
32+ const { minimumCharactersCount, waitInterval } = this . props ;
3333 clearTimeout ( this . timer ) ;
3434 this . setState ( { inputValue : text } ) ;
3535 if ( text . length > minimumCharactersCount ) {
@@ -39,7 +39,7 @@ class Autocomplete extends Component {
3939 } ,
4040 ( ) => {
4141 if ( this . mounted ) {
42- this . timer = setTimeout ( this . triggerChange , WAIT_INTERVAL ) ;
42+ this . timer = setTimeout ( this . triggerChange , waitInterval ) ;
4343 }
4444 } ,
4545 ) ;
@@ -193,6 +193,7 @@ Autocomplete.defaultProps = {
193193 autoCorrect : false ,
194194 minimumCharactersCount : 2 ,
195195 highlightText : true ,
196+ waitInterval : WAIT_INTERVAL ,
196197} ;
197198
198199Autocomplete . propTypes = {
@@ -202,6 +203,7 @@ Autocomplete.propTypes = {
202203 placeholderColor : string ,
203204 fetchDataUrl : string ,
204205 minimumCharactersCount : number ,
206+ waitInterval : number ,
205207 highlightText : bool ,
206208 rightContent : bool ,
207209 autoCorrect : bool ,
You can’t perform that action at this time.
0 commit comments