Skip to content
This repository was archived by the owner on May 15, 2022. It is now read-only.

Commit 4a67ec7

Browse files
committed
Added possibility to use custom item names for DatSelect items.
1 parent 0024227 commit 4a67ec7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/DatSelect.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export default class DatSelect extends Component {
4747
}
4848

4949
render() {
50-
const { path, label, labelWidth } = this.props;
50+
const { path, label, labelWidth, optionLabels } = this.props;
5151
const { value, options } = this.state;
5252
const labelText = isString(label) ? label : path;
5353

@@ -62,7 +62,7 @@ export default class DatSelect extends Component {
6262
style={{ width: `${100 - labelWidth}%` }}
6363
onChange={this.handleChange}
6464
>
65-
{options.map((item, index) => <option key={index} value={item}>{item}</option>)}
65+
{options.map((item, index) => <option key={index} value={item}>{optionLabels ? optionLabels[index] : item}</option>)}
6666
</select>
6767
</label>
6868
</li>

0 commit comments

Comments
 (0)