Skip to content

better support for constΒ #1241

@a-b-r-o-w-n

Description

@a-b-r-o-w-n

Prerequisites

Description

Currently, const is only used to validate the form data, but there is no UX to enforce it. This is a proposal to add more support of const.

Steps to Reproduce

https://rjsf-team.github.io/react-jsonschema-form/#eyJmb3JtRGF0YSI6e30sInNjaGVtYSI6eyJ0aXRsZSI6IkEgcmVnaXN0cmF0aW9uIGZvcm0iLCJkZXNjcmlwdGlvbiI6IkEgc2ltcGxlIGZvcm0gZXhhbXBsZS4iLCJ0eXBlIjoib2JqZWN0IiwicHJvcGVydGllcyI6eyJmaXJzdE5hbWUiOnsidHlwZSI6InN0cmluZyIsInRpdGxlIjoiRmlyc3QgbmFtZSIsImNvbnN0IjoiQ2h1Y2sifX19LCJ1aVNjaGVtYSI6e319

Expected behavior

const should be respected in various areas:

  • default form values
  • readonly / disabled form fields
  • any other places?

Actual behavior

Only form validation respects const. It does not get applied as a default form state and there is no UI indiciation that a field cannot be changed from a certain value.

Version

1.3.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions