react-native-modal-dropdown
Advanced tools
Comparing version 0.6.1 to 0.6.2
@@ -94,3 +94,3 @@ /** | ||
const {defaultIndex, defaultValue, options} = nextProps; | ||
buttonText = this._nextValue == null ? buttonText : this._nextValue.toString(); | ||
buttonText = this._nextValue == null ? buttonText : this._nextValue; | ||
selectedIndex = this._nextIndex == null ? selectedIndex : this._nextIndex; | ||
@@ -377,6 +377,7 @@ if (selectedIndex < 0) { | ||
highlightRow(sectionID, rowID); | ||
this._nextValue = rowData; | ||
const value = renderButtonText && renderButtonText(rowData) || rowData.toString(); | ||
this._nextValue = value; | ||
this._nextIndex = rowID; | ||
this.setState({ | ||
buttonText: renderButtonText && renderButtonText(rowData) || rowData.toString(), | ||
buttonText: value, | ||
selectedIndex: rowID | ||
@@ -383,0 +384,0 @@ }); |
{ | ||
"name": "react-native-modal-dropdown", | ||
"version": "0.6.1", | ||
"version": "0.6.2", | ||
"description": "A react-native dropdown component for both iOS and Android.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -22,2 +22,5 @@ [![npm version](https://badge.fury.io/js/react-native-modal-dropdown.svg)](https://badge.fury.io/js/react-native-modal-dropdown) | ||
### v0.6.2 | ||
- Fix [#139](https://github.com/sohobloo/react-native-modal-dropdown/issues/139) `renderButtonText` renders \[object Object] if there is a call to `setState` in `onSelect` or `renderButtonText` functions | ||
### v0.6.1 | ||
@@ -78,3 +81,3 @@ - Fix [#127](https://github.com/sohobloo/react-native-modal-dropdown/issues/127) `renderButtonText` does not work on `select(idx)` (Thanks to [@swb2016](https://github.com/swb2016)) | ||
`adjustFrame` | func | Yes | | This is a callback after the frame of the dropdown have been calculated and before showing. You will receive a style object as argument with some of the props like `width` `height` `top` `left` and `right`. Change them to appropriate values that accord with your requirement and **make the new style as the return value of this function**. | ||
`renderRow` | func | Yes | | Customize render option rows. **Will render a default row if `null`/`undefined`.** | ||
`renderRow` | func | Yes | | Customize render option rows: `function(option,index,isSelected)` **Will render a default row if `null`/`undefined`.** | ||
`renderSeparator` | func | Yes | | Customize render dropdown list separators. **Will render a default thin gray line if `null`/`undefined`.** | ||
@@ -81,0 +84,0 @@ `renderButtonText` | func | Yes | | Use this to extract and return text from option object. This text will show on button after option selected. **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
20010
402
98