Make sure preselected value is active
[PREMIUM-59]
This commit is contained in:
@@ -227,6 +227,7 @@ define([
|
|||||||
},
|
},
|
||||||
render: function () {
|
render: function () {
|
||||||
const items = this.getItems(this.props.field);
|
const items = this.getItems(this.props.field);
|
||||||
|
const selectedValues = this.getSelectedValues();
|
||||||
const options = items.map((item, index) => {
|
const options = items.map((item, index) => {
|
||||||
const label = this.getLabel(item);
|
const label = this.getLabel(item);
|
||||||
const searchLabel = this.getSearchLabel(item);
|
const searchLabel = this.getSearchLabel(item);
|
||||||
@@ -238,6 +239,7 @@ define([
|
|||||||
className="default"
|
className="default"
|
||||||
value={value}
|
value={value}
|
||||||
title={searchLabel}
|
title={searchLabel}
|
||||||
|
selected={value === selectedValues}
|
||||||
>
|
>
|
||||||
{ label }
|
{ label }
|
||||||
</option>
|
</option>
|
||||||
@@ -251,7 +253,7 @@ define([
|
|||||||
disabled={this.props.field.disabled}
|
disabled={this.props.field.disabled}
|
||||||
data-placeholder={this.props.field.placeholder}
|
data-placeholder={this.props.field.placeholder}
|
||||||
multiple={this.props.field.multiple}
|
multiple={this.props.field.multiple}
|
||||||
defaultValue={this.getSelectedValues()}
|
defaultValue={selectedValues}
|
||||||
{...this.props.field.validation}
|
{...this.props.field.validation}
|
||||||
>
|
>
|
||||||
{ this.insertEmptyOption() }
|
{ this.insertEmptyOption() }
|
||||||
|
Reference in New Issue
Block a user