rjsf-team/react-jsonschema-form

`patternProperties` number keys make the input get rendered at the very top of the `Form`

Open

#4,631 创建于 2025年5月17日

在 GitHub 查看
 (7 评论) (0 反应) (0 负责人)TypeScript (13,175 star) (2,136 fork)batch import
bugcorehelp wanted

描述

Prerequisites

What theme are you using?

core

Version

6.0.0-beta.8

Current Behavior

Adding a new patternProperties key that is a number makes the key name input get rendered at the very top of the Form:

Image

Notice that keys that have non-numeric characters in them are not affected by this issue.

Expected Behavior

Keys should at least remain grouped. It would be intuitive to always have them rendered in the order they were added.

If they should be reordered dynamically amongst themselves, I don't know. Maybe this could be a customizable behaviour set through a new prop or UiSchema property? Just like lists allow reordering, maybe?

Steps To Reproduce

  1. Go to the playground patternProperties example.
  2. Change the regex of the JSON Schema patternproperties property to "(.*?)", so it matches anything.
  3. Add a new property with a purely numeric key.
  4. Observe where the field gets rendered.

Environment

Irrelevant

Anything else?

No response

贡献者指南

`patternProperties` number keys make the input get rendered at the very top of the `Form` · rjsf-team/react-jsonschema-form#4631 | Good First Issue