react-native-modal-dropdown
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -30,5 +30,6 @@ import React, { Component } from 'react'; | ||
scrollEnabled: PropTypes.bool, | ||
saveScrollPosition: PropTypes.bool, | ||
defaultIndex: PropTypes.number, | ||
defaultValue: PropTypes.string, | ||
options: PropTypes.array.isRequired, | ||
options: PropTypes.array, | ||
accessible: PropTypes.bool, | ||
@@ -93,2 +94,3 @@ animated: PropTypes.bool, | ||
onSelect: PropTypes.func, | ||
numberOfLines: PropTypes.number | ||
}; | ||
@@ -100,2 +102,3 @@ | ||
scrollEnabled: true, | ||
saveScrollPosition: true, | ||
defaultIndex: -1, | ||
@@ -109,3 +112,4 @@ defaultValue: 'Please select...', | ||
renderButtonComponent: TouchableOpacity, | ||
renderRightComponent: View | ||
renderRightComponent: View, | ||
numberOfLines: 1 | ||
}; | ||
@@ -221,3 +225,4 @@ | ||
renderButtonProps, | ||
renderRightComponent | ||
renderRightComponent, | ||
numberOfLines | ||
} = this.props; | ||
@@ -238,3 +243,3 @@ const ButtonTouchable = renderButtonComponent; | ||
<View style={styles.button}> | ||
<Text style={[styles.buttonText, buttonTextStyle]} numberOfLines={1}> | ||
<Text style={[styles.buttonText, buttonTextStyle]} numberOfLines={numberOfLines}> | ||
{buttonText} | ||
@@ -357,2 +362,3 @@ </Text> | ||
scrollEnabled, | ||
saveScrollPosition, | ||
renderSeparator, | ||
@@ -364,2 +370,3 @@ showsVerticalScrollIndicator, | ||
} = this.props; | ||
const { selectedIndex } = this.state; | ||
@@ -371,2 +378,3 @@ return ( | ||
scrollEnabled={scrollEnabled} | ||
initialScrollIndex={saveScrollPosition ? selectedIndex : -1} | ||
style={styles.list} | ||
@@ -408,2 +416,3 @@ keyExtractor={(item, i) => (`key-${i}`)} | ||
]} | ||
testID={item} | ||
{...dropdownTextProps} | ||
@@ -410,0 +419,0 @@ > |
@@ -30,2 +30,3 @@ import React, { Component } from 'react'; | ||
scrollEnabled: PropTypes.bool, | ||
saveScrollPosition: PropTypes.bool, | ||
defaultIndex: PropTypes.number, | ||
@@ -86,2 +87,3 @@ defaultValue: PropTypes.string, | ||
scrollEnabled: true, | ||
saveScrollPosition: true, | ||
defaultIndex: -1, | ||
@@ -331,2 +333,3 @@ defaultValue: 'Please select...', | ||
scrollEnabled, | ||
saveScrollPosition, | ||
renderSeparator, | ||
@@ -338,2 +341,4 @@ showsVerticalScrollIndicator, | ||
const { selectedIndex } = this.state; | ||
return ( | ||
@@ -343,2 +348,3 @@ <FlatList | ||
scrollEnabled={scrollEnabled} | ||
initialScrollIndex={saveScrollPosition ? selectedIndex : -1} | ||
style={styles.list} | ||
@@ -345,0 +351,0 @@ keyExtractor={(item, i) => (`key-${i}`)} |
{ | ||
"name": "react-native-modal-dropdown", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A react-native dropdown component for both iOS and Android.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -24,2 +24,5 @@ [![npm version](https://badge.fury.io/js/react-native-modal-dropdown.svg)](https://badge.fury.io/js/react-native-modal-dropdown) | ||
### v1.0.1 | ||
- small fixes and more styling custimizations allowed | ||
### v1.0.0 | ||
@@ -35,7 +38,7 @@ - took over the package and merged user's PRs | ||
```sh | ||
npm i https://github.com/siemiatj/react-native-modal-dropdown -save | ||
npm i --save react-native-modal-dropdown | ||
``` | ||
or | ||
```sh | ||
yarn add https://github.com/siemiatj/react-native-modal-dropdown | ||
yarn add react-native-modal-dropdown | ||
``` | ||
@@ -79,2 +82,3 @@ | ||
`showsVerticalScrollIndicator` | bool | Yes | true | Show / hide vertical scroll indicator. | ||
`saveScrollPosition` | bool | Yes | true | Sets the scroll position to selected index. | ||
`style` | object | Yes | | Style of the button. | ||
@@ -81,0 +85,0 @@ `textStyle` | object | Yes | | Style of the button text. **Invalid in wrapper mode.** |
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
1733061
2064
115
0