Skip to content

Type "null" with default "null" shows error message "must be null" #4734

@Sourcekot

Description

@Sourcekot

Prerequisites

What theme are you using?

mui

Version

6.0.0-beta.14

Current Behavior

I'm using a field of type "null" with a default value of "null"

"empty": {
  "type": "null",
  "default": null
}

Previously this worked without a problem but after updating from 6.0.0-beta.12 to 6.0.0-beta.14 it is displaying a "must be null" error message on submit. It works again if I set it to "type": ["string", "null"] but that's not a solution just a workaround.

Expected Behavior

The field should display no error message.

Steps To Reproduce

In the Playground Link you can see that the false error message is displayed after pressing the submit button. But I don't know if it is caused by the same problem as the playground somehow automatically sets the formdata to:

{
  "empty": {
    "empty": null
  }
}

Environment

- OS: Microsoft Windows 11 Pro (Version: 10.0.26100 Build 26100)
- Node: 22.15.0
- npm: 11.3.0

Anything else?

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions