Fix selection.jsx by adding a check before trying to destroy the select2 instance
This commit is contained in:
@ -33,6 +33,14 @@ function(
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
componentWillUnmount: function() {
|
componentWillUnmount: function() {
|
||||||
|
if(
|
||||||
|
!this.props.field.multiple
|
||||||
|
|| this.state.initialized === false
|
||||||
|
|| this.refs.select === undefined
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
jQuery('#'+this.refs.select.id).select2('destroy');
|
jQuery('#'+this.refs.select.id).select2('destroy');
|
||||||
},
|
},
|
||||||
setupSelect2: function() {
|
setupSelect2: function() {
|
||||||
|
Reference in New Issue
Block a user