zhigang1992 / react-native-jsonschema-form

react native implementation of https://github.com/rjsf-team/react-jsonschema-form
29 stars 20 forks source link

Wrong with enum values #9

Open sonhuynhth opened 3 years ago

sonhuynhth commented 3 years ago

Hi Zhigang, I am very interested in your project, but when I run it in my project there are some problems. With the type of property is enums, I would like it view as a dropdown box, but currently its view is a select/option. Screen Shot 2021-03-13 at 01 08 59 I expect the result to look like the image below Screen Shot 2021-03-13 at 01 12 07

This is my schema { "type": "object", "title": "Daily glucose values", "required": [], "properties": { "azdqamatgu": { "type": "array", "items": { "type": "object", "properties": { "hour": { "enum": ["0", "1", "2"], "type": "string", "title": "hour" }, "minute": { "enum": ["0", "1", "2", "3", "4"], "type": "string", "title": "minute" } } }, "title": "X giờ / lần", "primitive": "default" } } } Please help me, thank you!

chriscoomber commented 2 years ago

It looks like a "select widget" hasn't been implemented for this theme, so we're getting "radio widgets" instead.

https://github.com/zhigang1992/react-native-jsonschema-form/blob/d22d5fd3f9790f4021d2c03443d6b9b388f1ad7d/src/widgets/Widgets.ts#L20