Skip to content

Vanilla react renderer: integer enum radio group values are converted to string #2045

@sque89

Description

@sque89

Describe the bug

I want to render an integer enum control as a radio via the following schemas:

schema.json

"amount": {
  "type": "integer",
  "enum": [50, 100, 250, 500]
}

uischema.json

{
  "type": "Control",
  "scope": "#/properties/amount",
  "options": {
    "format": "radio"
  }
}

The issue is now that apparently the values of the radio inputs are converted/considered to be string instead of integers. Because of that i cannot select any of the values because the validator is righfully complaining that the selected values are not valid.

Expected behavior

The radio group values should be selectable

Steps to reproduce the issue

  1. Provide schema as outlined above
  2. Try to select one of the options

Screenshots

Peek 2022-11-09 16-18

In which browser are you experiencing the issue?

Google Chrome Version 107.0.5304.110 (Official Build) (64-bit)

Which Version of JSON Forms are you using?

v3.0.0

Framework

Other (please specify in the Additional context field)

RendererSet

Vanilla

Additional context

I am using Preact

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions