File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ export default class ModalDropdown extends Component {
9191 componentWillReceiveProps ( nextProps ) {
9292 let { buttonText, selectedIndex} = this . state ;
9393 const { defaultIndex, defaultValue, options} = nextProps ;
94- buttonText = this . _nextValue == null ? buttonText : this . _nextValue . toString ( ) ;
94+ buttonText = this . _nextValue == null ? buttonText : this . _nextValue ;
9595 selectedIndex = this . _nextIndex == null ? selectedIndex : this . _nextIndex ;
9696 if ( selectedIndex < 0 ) {
9797 selectedIndex = defaultIndex ;
@@ -373,10 +373,11 @@ export default class ModalDropdown extends Component {
373373 const { onSelect, renderButtonText, onDropdownWillHide} = this . props ;
374374 if ( ! onSelect || onSelect ( rowID , rowData ) !== false ) {
375375 highlightRow ( sectionID , rowID ) ;
376- this . _nextValue = rowData ;
376+ const value = renderButtonText && renderButtonText ( rowData ) || rowData . toString ( ) ;
377+ this . _nextValue = value ;
377378 this . _nextIndex = rowID ;
378379 this . setState ( {
379- buttonText : renderButtonText && renderButtonText ( rowData ) || rowData . toString ( ) ,
380+ buttonText : value ,
380381 selectedIndex : rowID
381382 } ) ;
382383 }
You can’t perform that action at this time.
0 commit comments