Skip to content

Commit 1bff6f4

Browse files
committed
Close #29: Add support for enum keyword
1 parent bce05ad commit 1bff6f4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/ui.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,13 @@ function FormField(props) {
4141
};
4242

4343
let type = props.schema.type;
44-
if (props.schema.choices) {
45-
inputProps.options = props.schema.choices;
44+
let choices = props.schema.choices || props.schema.enum;
45+
46+
if (choices) {
47+
inputProps.options = choices;
4648
type = 'select';
4749
}
50+
4851
if (props.schema.widget) {
4952
if (props.schema.widget === 'multiselect' && props.parentType !== 'array') {
5053
// pass

0 commit comments

Comments
 (0)