Commit cd12d20a authored by Phyks (Lucas Verney)'s avatar Phyks (Lucas Verney)
Browse files

Match only labels and not values in Select fields

parent b1064c2d
Pipeline #52406 failed with stages
in 1 minute and 10 seconds
...@@ -31,6 +31,7 @@ class CategorySelect extends React.Component { ...@@ -31,6 +31,7 @@ class CategorySelect extends React.Component {
id={this.props.id} id={this.props.id}
onChange={this.handleChange} onChange={this.handleChange}
options={this.props.options} options={this.props.options}
matchProp="label"
/> />
); );
} }
......
...@@ -58,6 +58,7 @@ const SearchTypeSelect = connect( ...@@ -58,6 +58,7 @@ const SearchTypeSelect = connect(
onChange={props.handleOperationType} onChange={props.handleOperationType}
options={typeOptions} options={typeOptions}
value={props.defaultValue} value={props.defaultValue}
matchProp="label"
/> />
); );
}); });
...@@ -97,7 +98,7 @@ const SearchCategorySelect = connect( ...@@ -97,7 +98,7 @@ const SearchCategorySelect = connect(
} }
].concat(categories.map(cat => ({ value: cat.id, label: cat.title }))); ].concat(categories.map(cat => ({ value: cat.id, label: cat.title })));
return <Select value={props.defaultValue} onChange={props.handleChange} options={options} />; return <Select value={props.defaultValue} onChange={props.handleChange} options={options} matchProp="label" />;
}); });
const MinDatePicker = connect( const MinDatePicker = connect(
......
...@@ -27,6 +27,7 @@ class TypeSelect extends React.Component { ...@@ -27,6 +27,7 @@ class TypeSelect extends React.Component {
clearable={false} clearable={false}
onChange={this.handleChange} onChange={this.handleChange}
options={this.props.types} options={this.props.types}
matchProp="label"
/> />
); );
} }
......
...@@ -254,6 +254,7 @@ class InitForm extends React.Component { ...@@ -254,6 +254,7 @@ class InitForm extends React.Component {
clearValueText={$t('client.search.clear')} clearValueText={$t('client.search.clear')}
value={selectedBankDescr && selectedBankDescr.uuid} value={selectedBankDescr && selectedBankDescr.uuid}
options={options} options={options}
matchProp="label"
/> />
</div> </div>
</div> </div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment