react-native-autocomplete-input
Advanced tools
Comparing version 2.0.0-rc.0 to 2.0.0
37
index.js
@@ -42,3 +42,7 @@ import React, { Component, PropTypes } from 'react'; | ||
*/ | ||
onShowResults: PropTypes.func | ||
onShowResults: PropTypes.func, | ||
/** | ||
* renders custom TextInput. All props passed to this function. | ||
*/ | ||
renderTextInput: PropTypes.func | ||
}; | ||
@@ -109,16 +113,24 @@ | ||
_renderTextInput() { | ||
const { onEndEditing, renderTextInput, style } = this.props; | ||
const props = { | ||
style: [styles.input, style], | ||
ref: ref => (this.textInput = ref), | ||
onEndEditing: e => | ||
this._showResults(false) || (onEndEditing && onEndEditing(e)), | ||
...this.props | ||
}; | ||
return renderTextInput | ||
? renderTextInput(props) | ||
: (<TextInput {...props} />); | ||
} | ||
render() { | ||
const { showResults } = this.state; | ||
const { containerStyle, inputContainerStyle, onEndEditing, style, ...props } = this.props; | ||
const { containerStyle, inputContainerStyle } = this.props; | ||
return ( | ||
<View style={[styles.container, containerStyle]}> | ||
<View style={[styles.inputContainer, inputContainerStyle]}> | ||
<TextInput | ||
style={[styles.input, style]} | ||
ref={ref => (this.textInput = ref)} | ||
onEndEditing={e => | ||
this._showResults(false) || (onEndEditing && onEndEditing(e)) | ||
} | ||
{...props} | ||
/> | ||
{this._renderTextInput()} | ||
</View> | ||
@@ -139,7 +151,6 @@ {showResults && this._renderItems()} | ||
container: { | ||
zIndex: 1, | ||
zIndex: 1 | ||
}, | ||
inputContainer: { | ||
...border, | ||
marginBottom: 0 | ||
...border | ||
}, | ||
@@ -146,0 +157,0 @@ input: { |
{ | ||
"name": "react-native-autocomplete-input", | ||
"version": "2.0.0-rc.0", | ||
"version": "2.0.0", | ||
"description": "Pure javascript autocomplete input for react-native", | ||
"main": "index.js", | ||
"options": { | ||
"mocha": "--require react-native-mock/mock.js --compilers js:babel-core/register ./__tests__/**/*.js" | ||
"mocha": "--require react-native-mock/mock.js --compilers js:babel-register ./__tests__/**/*.js" | ||
}, | ||
@@ -48,16 +48,15 @@ "scripts": { | ||
"enzyme": "^2.3.0", | ||
"eslint": "^3.2.2", | ||
"eslint-config-airbnb": "^10.0.0", | ||
"eslint": "^3.5.0", | ||
"eslint-config-airbnb": "^11.0.0", | ||
"eslint-plugin-babel": "^3.3.0", | ||
"eslint-plugin-import": "^1.9.2", | ||
"eslint-plugin-jsx-a11y": "^2.0.1", | ||
"eslint-plugin-react": "^6.0.0", | ||
"eslint-plugin-jsx-a11y": "^2.2.1", | ||
"eslint-plugin-react": "^6.2.0", | ||
"estraverse-fb": "^1.3.1", | ||
"jest-cli": "^13.0.0", | ||
"mocha": "^2.5.3", | ||
"nyc": "^6.6.1", | ||
"react": "^15.2.1", | ||
"react": "^15.3.1", | ||
"react-addons-test-utils": "^15.2.1", | ||
"react-dom": "^15.2.1", | ||
"react-native": "^0.31.0", | ||
"react-native": "^0.34.0", | ||
"react-native-mock": "^0.2.3", | ||
@@ -64,0 +63,0 @@ "sinon": "^1.17.4" |
@@ -24,2 +24,6 @@ # react-native-autocomplete-input | ||
### Android | ||
On Android please install the v.1.12 release. The v2.0.0 release don’t show the suggestion list correctly because RN for Android doesn’t support overflows (see [#20](https://github.com/l-urence/react-native-autocomplete-input/issues/2://github.com/l-urence/react-native-autocomplete-input/issues/20)). | ||
### Example | ||
This brief example should illustrate the usage of the autocomplete: | ||
@@ -61,4 +65,5 @@ | ||
| onShowResult | function | `onShowResult` will be called when the autocomplete suggestions appear or disappear. | ||
| renderTextInput | function | render custom TextInput. All props passed to this function. | ||
## Contribute | ||
Feel free to open issues or do a PR! | ||
Feel free to open issues or do a PR! |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
10145
25
154
0
68