Skip to content

Commit 998dd27

Browse files
authored
Populate title for oneOf when referenced through $ref (#96)
1 parent 8a40fab commit 998dd27

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/ui.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -586,9 +586,10 @@ class OneOfTopLevel extends React.Component {
586586
}
587587

588588
getOptions = () => {
589-
return this.props.args.schema[this.schemaName].map((option, index) => {
590-
return {label: option.title || 'Option ' + (index + 1), value: index};
591-
});
589+
return Array.from(
590+
this.props.args.schema[this.schemaName].keys(),
591+
(index) => ({label: this.getSchema(index).title || 'Option ' + (index + 1), value: index})
592+
);
592593
}
593594

594595
getSchema = (index) => {

0 commit comments

Comments
 (0)