Skip to content

New enumTitles not working => old enumNames have warnings ⚠️ that are deprecated 🐛 #4072

@Fremen1990

Description

@Fremen1990

Prerequisites

What theme are you using?

material-ui

Version

5.16.1

Current Behavior

Current state:

I use currently JSON Schema with enumNames but in DevTools it is shouting that enumNames are depreciated ⚠️ and will be removed and to use enumTitles.

(console warnings ⚠️ are extremaly long and plenty of them)

image


After trying to change to enumTitles:

After changing to enumTitles I have the same label and value in my inputs and I do not have my input label which was normally working when it was under enumNames

image

image

Expected Behavior

To have label from enumTitles and value from enum => to just have working enumTitles like enumNames (depreciated) is working

Steps To Reproduce

Reproduce console warnings ⚠️

You can reproduce console warnings ⚠️ just using enumNames in local environment and devTools will shout as loud as possible 😅


Reproduce enumTitles not working as labels

You can check if enumTitles not working you can just paste this example JSON Schema into playground:

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

{
  "title": "Color Selector",
  "type": "object",
  "properties": {
    "favoriteColor": {
      "type": "string",
      "title": "Choose your favorite color",
      "enum": [
        "red",
        "green",
        "blue"
      ],
      "enumTitles": [
        "Red like a fire",
        "Green like a grass",
        "Blue like an ocean"
      ]
    }
  },
  "required": [
    "favoriteColor"
  ]
}

Environment

- OS: Windows 11
- Node: 18.1
- pnpm: 8.14

Anything else?

No response

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