Adds getter for field ID
This commit is contained in:
@@ -41,6 +41,10 @@ define([
|
||||
this.destroySelect2();
|
||||
}
|
||||
},
|
||||
getFieldId: function (data) {
|
||||
const props = data || this.props;
|
||||
return props.field.id || props.field.name;
|
||||
},
|
||||
destroySelect2: function () {
|
||||
if (this.isSelect2Initialized()) {
|
||||
jQuery(`#${this.refs.select.id}`).select2('destroy');
|
||||
@@ -215,7 +219,7 @@ define([
|
||||
|
||||
return (
|
||||
<select
|
||||
id={this.props.field.id || this.props.field.name}
|
||||
id={this.getFieldId()}
|
||||
ref="select"
|
||||
disabled={this.props.field.disabled}
|
||||
data-placeholder={this.props.field.placeholder}
|
||||
|
Reference in New Issue
Block a user