react-jsonschema-form icon indicating copy to clipboard operation
react-jsonschema-form copied to clipboard

html input maxlength minlength attributes

Open sanjeev16011994 opened this issue 2 years ago • 1 comments

Prerequisites

What theme are you using?

core

Is your feature request related to a problem? Please describe.

No response

Describe the solution you'd like

i would like to have maxlength attribute to input type text to allow only certain values. like if max length is set to 10 . the input field will not take more than ten characters

Describe alternatives you've considered

No response

sanjeev16011994 avatar May 20 '22 11:05 sanjeev16011994

If you do something like the following it should work.

schema = {
  type: "string"
}

uiSchema = {
  "ui:options": {
    maxLength: 10
  }
}

<Form schema={schema} uiSchema={uiSchema} />

heath-freenome avatar Aug 22 '22 22:08 heath-freenome

@sanjeev16011994 please open a new issue if the provided solution does not work. Thanks!

nickgros avatar Apr 28 '23 15:04 nickgros