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

Default widget for number fields #966

Closed
1 of 2 tasks
leplatrem opened this issue Jun 29, 2018 · 2 comments · Fixed by #1183
Closed
1 of 2 tasks

Default widget for number fields #966

leplatrem opened this issue Jun 29, 2018 · 2 comments · Fixed by #1183

Comments

@leplatrem
Copy link
Contributor

Prerequisites

  • I have read the documentation;
  • In the case of a bug report, I understand that providing a SSCCE example is tremendously useful to the maintainers.

Description

Default widget for numbers seems to be text fields.

Steps to Reproduce

const Form = JSONSchemaForm.default;
const schema = {
  title: "react-jsonschema-form demo",
  type: "object",
  properties: {
  	rate: {type: "number"},
    percent: {type: "number"}
  }
};
const uiSchema = {
  percent: {
    "ui:widget": "range"
  }
};

ReactDOM.render(<Form schema={schema} uiSchema={uiSchema}/>, 
             document.getElementById("main"));

Expected behavior

I would expect the serialized value to be an integer or float

Actual behavior

Currently the value is quoted as string

@yankeyhs
Copy link

yankeyhs commented Dec 2, 2019

Hi I want to place class to input instead of it's parent element, But Nothing is documented for this.

check PFA
red part className I want in green part too.
Screenshot 2019-12-03 at 1 19 40 AM

@epicfaace
Copy link
Member

@yankeyhs we can't do this now -- you'd have to make your own custom widget in order to do so.

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

Successfully merging a pull request may close this issue.

3 participants