File tree Expand file tree Collapse file tree 3 files changed +6
-1
lines changed Expand file tree Collapse file tree 3 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -162,6 +162,7 @@ Change valueExtractor and pass the data to Autocomplete without fetchDataUrl
162162 handleSelectItem | Selection callback (agrs: item, index) | Function | -
163163 onDropdownShow | Show keyboard | Function | -
164164 onDropdownClose | Hide keyboard | Function | -
165+ onChangeText | Autocomplete input text changes | Function | -
165166 renderIcon | Render icon near input | Function | -
166167 valueExtractor | Extract value from item (args: item, index) | Function | ({ value }) => value
167168 rightTextExtractor | Extract value from item (args: item, index) | Function | ({ value }) => value
Original file line number Diff line number Diff line change @@ -29,7 +29,10 @@ class Autocomplete extends Component {
2929 }
3030
3131 handleInputChange ( text ) {
32- const { minimumCharactersCount, waitInterval} = this . props ;
32+ const { onChangeText, minimumCharactersCount, waitInterval} = this . props ;
33+ if ( onChangeText ) {
34+ onChangeText ( text ) ;
35+ }
3336 clearTimeout ( this . timer ) ;
3437 this . setState ( { inputValue : text } ) ;
3538 if ( text . length > minimumCharactersCount ) {
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ type AutocompleteProps = {
3737 handleSelectItem : ( item : any , index : number ) => void ,
3838 onDropdownShow : ( ) => void ,
3939 onDropdownClose : ( ) => void ,
40+ onChangeText ?: ( search : string ) => void ,
4041 renderIcon ?: ( ) => void ,
4142 valueExtractor ?: ( item : any ) => void ,
4243 rightTextExtractor ?: ( item : any ) => void ,
You can’t perform that action at this time.
0 commit comments