react-native-autocomplete-input
Advanced tools
Comparing version 3.6.0-rc to 3.6.0
36
index.js
@@ -45,6 +45,2 @@ import React, { Component } from 'react'; | ||
/* | ||
* Render list above input. Defaults to false. | ||
*/ | ||
invertList: PropTypes.bool, | ||
/* | ||
* These styles will be applied to the container which surrounds | ||
@@ -57,3 +53,3 @@ * the result list. | ||
*/ | ||
listStyle: ListView.propTypes.style, | ||
listStyle: ViewPropTypes.style, | ||
/** | ||
@@ -83,3 +79,7 @@ * `onShowResults` will be called when list is going to | ||
*/ | ||
renderTextInput: PropTypes.func | ||
renderTextInput: PropTypes.func, | ||
/** | ||
* `rowHasChanged` will be used for data objects comparison for dataSource | ||
*/ | ||
rowHasChanged: PropTypes.func | ||
}; | ||
@@ -90,3 +90,2 @@ | ||
defaultValue: '', | ||
invertList: false, | ||
keyboardShouldPersistTaps: 'always', | ||
@@ -96,3 +95,4 @@ onStartShouldSetResponderCapture: () => false, | ||
renderSeparator: null, | ||
renderTextInput: props => <TextInput {...props} /> | ||
renderTextInput: props => <TextInput {...props} />, | ||
rowHasChanged: (r1, r2) => r1 !== r2 | ||
}; | ||
@@ -102,3 +102,4 @@ | ||
super(props); | ||
const ds = new ListView.DataSource({ rowHasChanged: (r1, r2) => r1 !== r2 }); | ||
const ds = new ListView.DataSource({ rowHasChanged: props.rowHasChanged }); | ||
this.state = { dataSource: ds.cloneWithRows(props.data) }; | ||
@@ -162,21 +163,10 @@ this.resultList = null; | ||
}; | ||
return renderTextInput(props); | ||
} | ||
/** | ||
* Renders list above input - will invert entire autocomplete container | ||
*/ | ||
renderContainerDirection() { | ||
const containerStyle = [styles.container, this.props.containerStyle]; | ||
if (this.props.invertList) { | ||
containerStyle.push({ flexDirection: 'column-reverse' }); | ||
} | ||
return containerStyle; | ||
} | ||
render() { | ||
const { dataSource } = this.state; | ||
const { | ||
containerStyle, | ||
hideResults, | ||
@@ -194,3 +184,3 @@ inputContainerStyle, | ||
return ( | ||
<View style={this.renderContainerDirection()}> | ||
<View style={[styles.container, containerStyle]}> | ||
<View style={[styles.inputContainer, inputContainerStyle]}> | ||
@@ -197,0 +187,0 @@ {this.renderTextInput()} |
{ | ||
"name": "react-native-autocomplete-input", | ||
"version": "3.6.0-rc", | ||
"version": "3.6.0", | ||
"description": "Pure javascript autocomplete input for react-native", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -63,4 +63,4 @@ # react-native-autocomplete-input | ||
<Text>Some content</Text> | ||
<View /> | ||
<View> | ||
</View> | ||
</View> | ||
); | ||
@@ -88,6 +88,5 @@ } | ||
| containerStyle | style | These styles will be applied to the container which surrounds the autocomplete component. | | ||
| hideResults | bool | Set to `true` to hide the suggestion list. | | ||
| hideResults | bool | Set to `true` to hide the suggestion list. | ||
| data | array | An array with suggestion items to be rendered in `renderItem(item)`. Any array with length > 0 will open the suggestion list and any array with length < 1 will hide the list. | | ||
| inputContainerStyle | style | These styles will be applied to the container which surrounds the textInput component. | | ||
| invertList | bool | Set to `true` to render the list above input field. | | ||
| listContainerStyle | style | These styles will be applied to the container which surrounds the result list. | | ||
@@ -94,0 +93,0 @@ | listStyle | style | These style will be applied to the result list. | |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
13243
231
104