Skip to content

patternProperties invalid regex keys' behaviour is unintuitive to the user #4630

@TheOneTheOnlyJJ

Description

@TheOneTheOnlyJJ

Prerequisites

What theme are you using?

core

Version

6.0.0-beta.8

Current Behavior

If a patternProperty with a key length of 1 is introduced, the Form does not display any input field for the value.
Like this, from the playground:

Image

This applies to all themes.

I opened this issue thinking that keys of length 1 were not handled correctly by the library.
Upon closer inspection and playing around, I realised this is not the case. My keys did not match the regex required by patternProperties, thus not displaying a value input field.

This is very unintuitive. I would not expect a user to be aware of the regex not matching just by the absence of the value input field (I clearly was not). A proper error should be rendered in the key name field.

Expected Behavior

A value field is rendered no matter the key length.

It should be clear that the key name does not match the patternProperties regex when such is the case.

Steps To Reproduce

  1. Go to the playground patternProperties example.
  2. Add a new key of length 1, or any key that does not match the patternProperties regex.
  3. Observe how the value input field does not get rendered.
  4. Notice how, as a user, you have no feedback for why the value input field is not rendered.

Environment

Irrelevant

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