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

Commit 0e11be6

Browse files
committed
Rebase
2 parents e6b1c37 + f6ea20b commit 0e11be6

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/components/DatSelect.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export default class DatSelect extends Component {
1212
path: PropTypes.string,
1313
label: PropTypes.string,
1414
options: PropTypes.array.isRequired,
15+
optionLabels: PropTypes.array,
1516
labelWidth: PropTypes.string.isRequired,
1617
liveUpdate: PropTypes.bool.isRequired,
1718
onUpdate: PropTypes.func,
@@ -23,6 +24,7 @@ export default class DatSelect extends Component {
2324
style: null,
2425
path: null,
2526
label: null,
27+
optionLabels: null,
2628
onUpdate: () => null
2729
};
2830

@@ -51,7 +53,14 @@ export default class DatSelect extends Component {
5153
};
5254

5355
render() {
54-
const { path, label, labelWidth, className, style } = this.props;
56+
const {
57+
path,
58+
label,
59+
labelWidth,
60+
optionLabels,
61+
className,
62+
style
63+
} = this.props;
5564
const { value, options } = this.state;
5665
const labelText = isString(label) ? label : path;
5766

@@ -69,7 +78,7 @@ export default class DatSelect extends Component {
6978
{options.map((item, index) => (
7079
// eslint-disable-next-line react/no-array-index-key
7180
<option key={index} value={item}>
72-
{item}
81+
{optionLabels ? optionLabels[index] : item}
7382
</option>
7483
))}
7584
</select>

0 commit comments

Comments
 (0)