Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
sque89 opened this issue Nov 9, 2022 · 1 comment · Fixed by #2205
Closed

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

sque89 opened this issue Nov 9, 2022 · 1 comment · Fixed by #2205
Assignees
Milestone

Comments

@sque89
Copy link

sque89 commented Nov 9, 2022

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

@sdirix sdirix added this to the 3.x milestone Nov 13, 2022
@2x01101110
Copy link

Same issue with Vue Vanilla + Vue 3, latest version.
speed: { type: "integer", enum: [1, 2, 3], }
Will return string value and not integer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants