File tree Expand file tree Collapse file tree 3 files changed +5
-9
lines changed
withKeyboardAwareScrollView Expand file tree Collapse file tree 3 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -185,7 +185,9 @@ class Autocomplete extends Component {
185185 keyboardType = { keyboardType }
186186 onChangeText = { text => this . handleInputChange ( text ) }
187187 onFocus = { event => {
188- scrollToInput ( findNodeHandle ( event . target ) ) ;
188+ if ( scrollToInput ) {
189+ scrollToInput ( findNodeHandle ( event . target ) ) ;
190+ }
189191 } }
190192 />
191193 { loading && (
@@ -239,7 +241,7 @@ Autocomplete.propTypes = {
239241
240242 valueExtractor : func ,
241243 renderIcon : func ,
242- scrollToInput : func . isRequired ,
244+ scrollToInput : func ,
243245 handleSelectItem : func . isRequired ,
244246 onDropdownClose : func ,
245247 onDropdownShow : func ,
Original file line number Diff line number Diff line change @@ -66,12 +66,6 @@ const withKeyboardAwareScrollView = WrappedComponent => {
6666 }
6767
6868 render ( ) {
69- const wrappedComponentProps = {
70- scrollToInput : this . scrollToInput ,
71- keyboardDidHide : this . keyboardDidHide ,
72- keyboardDidShow : this . keyboardDidShow ,
73- } ;
74-
7569 return (
7670 < KeyboardAwareScrollView
7771 innerRef = { ref => {
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ type AutocompleteProps = {
3535 containerStyle ?: StyleProp < ViewStyle > ;
3636 scrollStyle ?: StyleProp < ViewStyle > ;
3737
38- scrollToInput : ( ev : any ) => void ,
38+ scrollToInput ? : ( ev : any ) => void ,
3939 handleSelectItem : ( item : any , index : number ) => void ,
4040 onDropdownShow ?: ( ) => void ,
4141 onDropdownClose ?: ( ) => void ,
You can’t perform that action at this time.
0 commit comments