Fix selection.jsx by adding a check before trying to destroy the select2 instance

This commit is contained in:
Jonathan Labreuille
2016-04-26 12:19:39 +02:00
parent 8d56e8582f
commit 256bca8ed9

View File

@ -33,6 +33,14 @@ function(
}
},
componentWillUnmount: function() {
if(
!this.props.field.multiple
|| this.state.initialized === false
|| this.refs.select === undefined
) {
return;
}
jQuery('#'+this.refs.select.id).select2('destroy');
},
setupSelect2: function() {