Skip to content

How to make textarea autosize? #361

@ngocdaothanh

Description

@ngocdaothanh

Thank you for this great library.

I have a question about setting the number of rows for textare:

By default, there are only 5 rows:
https://github.com/vip-git/react-jsonschema-form-material-ui/blob/master/src/fields/components/Input/utils/get-text-area-props.js

I can increase it to 15 like this:
https://react-jsonschema-form.readthedocs.io/en/v1.8.1/form-customization/#textarea-rows-option

const uiSchema = {
  "ui:widget": "textarea",
  "ui:options": {
    rows: 15
  }
}

But how to make it autosize?

Material UI supports this feature:
https://material-ui.com/components/textarea-autosize/
https://material-ui.com/components/text-fields/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions