Skip to content

Commit 3394b4e

Browse files
committed
Fixes #19
1 parent 814615e commit 3394b4e

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

components/Autocomplete/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff 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,

components/withKeyboardAwareScrollView/index.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff 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 => {

index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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,

0 commit comments

Comments
 (0)