Add variable to closure to delete correct suggestion

This commit is contained in:
Aaron Lindsay 2017-01-01 21:17:44 -05:00
parent d8fdf68cbb
commit c4ea521e52

View File

@ -67,8 +67,9 @@ module.exports = React.createClass({
if (i == 0) { if (i == 0) {
var self = this; var self = this;
var localSuggestion = suggestion;
var popFunction = function(){ var popFunction = function(){
return function(){self.props.removeSuggestion(suggestion);}; return function(){self.props.removeSuggestion(localSuggestion);};
}(); }();
suggestions.push(( suggestions.push((
<Row key={suggestion.SuggestionId}><Panel> <Row key={suggestion.SuggestionId}><Panel>