react-native-modal-dropdown
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -41,3 +41,3 @@ /** | ||
defaultValue: PropTypes.string, | ||
options: PropTypes.arrayOf(PropTypes.string), | ||
options: PropTypes.array, | ||
@@ -75,3 +75,3 @@ style: PropTypes.oneOfType([PropTypes.number, PropTypes.object, PropTypes.array]), | ||
componentWillReceiveProps(nextProps) { | ||
var buttonText = this._nextValue == null ? this.state.buttonText : this._nextValue; | ||
var buttonText = this._nextValue == null ? this.state.buttonText : this._nextValue.toString(); | ||
var selectedIndex = this._nextIndex == null ? this.state.selectedIndex : this._nextIndex; | ||
@@ -134,3 +134,3 @@ if (selectedIndex < 0) { | ||
if (idx >= 0) { | ||
value = this.props.options[idx]; | ||
value = this.props.options[idx].toString(); | ||
} | ||
@@ -284,3 +284,4 @@ | ||
switch (row.type.displayName) { | ||
case 'TouchableHighlight': { | ||
case 'TouchableHighlight': | ||
{ | ||
return ( | ||
@@ -293,3 +294,4 @@ <TouchableHighlight {...props}> | ||
break; | ||
case 'TouchableOpacity': { | ||
case 'TouchableOpacity': | ||
{ | ||
return ( | ||
@@ -302,3 +304,4 @@ <TouchableOpacity {...props}> | ||
break; | ||
case 'TouchableWithoutFeedback': { | ||
case 'TouchableWithoutFeedback': | ||
{ | ||
return ( | ||
@@ -311,3 +314,4 @@ <TouchableWithoutFeedback {...props}> | ||
break; | ||
case 'TouchableWithNativeFeedback': { | ||
case 'TouchableWithNativeFeedback': | ||
{ | ||
return ( | ||
@@ -338,3 +342,3 @@ <TouchableWithNativeFeedback {...props}> | ||
this.setState({ | ||
buttonText: rowData, | ||
buttonText: rowData.toString(), | ||
selectedIndex: rowID, | ||
@@ -361,3 +365,2 @@ }); | ||
button: { | ||
flexGrow: 1, | ||
justifyContent: 'center', | ||
@@ -369,7 +372,7 @@ }, | ||
modal: { | ||
flex: 1, | ||
flexGrow: 1, | ||
}, | ||
dropdown: { | ||
position: 'absolute', | ||
height: (32 + StyleSheet.hairlineWidth) * 5, | ||
height: (33 + StyleSheet.hairlineWidth) * 5, | ||
borderWidth: StyleSheet.hairlineWidth, | ||
@@ -385,10 +388,8 @@ borderColor: 'lightgray', | ||
list: { | ||
flex: 1, | ||
//flexGrow: 1, | ||
}, | ||
rowText: { | ||
flex: 1, | ||
paddingHorizontal: 6, | ||
paddingVertical: 10, | ||
fontSize: 11, | ||
height: 32, | ||
lineHeight: 32, | ||
color: 'gray', | ||
@@ -395,0 +396,0 @@ backgroundColor: 'white', |
{ | ||
"name": "react-native-modal-dropdown", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "A react-native dropdown component for both iOS and Android.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -24,2 +24,6 @@ [![npm version](https://badge.fury.io/js/react-native-modal-dropdown.svg)](https://badge.fury.io/js/react-native-modal-dropdown) | ||
### v0.4.1 | ||
- Fix bug: [\#27](https://github.com/sohobloo/react-native-modal-dropdown/issues/27) Fix a flex style bug. | ||
- Enhancement: [\#26](https://github.com/sohobloo/react-native-modal-dropdown/issues/26) Support object type of options. | ||
### v0.4.0 | ||
@@ -31,3 +35,3 @@ - New feature: | ||
- Enhancement: Compatible with `react-native` v0.36.0 which has a [break change](https://github.com/facebook/react-native/commit/0a9b6bedb312eba22c5bc11498b1cc41363e5f27) causes the default button with zero size. | ||
- Enhancement: [#16](https://github.com/sohobloo/react-native-modal-dropdown/issues/16) Prevent from warnings if array of styles is used instead of stylesheet or object. Thanks to @NikolaBorislavovHristov . | ||
- Enhancement: [\#16](https://github.com/sohobloo/react-native-modal-dropdown/issues/16) Prevent from warnings if array of styles is used instead of stylesheet or object. Thanks to @NikolaBorislavovHristov . | ||
@@ -90,3 +94,3 @@ ### v0.3.2 | ||
`defaultValue` | string | Yes | Please select... | Init text of the button. **Invalid in wrapper mode.** | ||
`options` | arrayOf(string)| Yes| | Options. **The dropdown will show a loading indicator if `options` is `null`/`undefined`.** | ||
`options` | array | Yes | | Options. **The dropdown will show a loading indicator if `options` is `null`/`undefined`.** | ||
`style` | object | Yes | | Style of the button. | ||
@@ -93,0 +97,0 @@ `textStyle` | object | Yes | | Style of the button text. **Invalid in wrapper mode.** |
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
18854
358
112