Skip to content

Conversation

heath-freenome
Copy link
Member

@heath-freenome heath-freenome commented Aug 16, 2025

Reasons for making this change

Fixes #4676 by adding support for indexes into the LayoutGridField

  • Updated LayoutGridField to add support for arrays
  • Updated the LayoutGridField to add 100% validation for the new arrays code

Using the schema in the LayoutGridField tests and this uiSchema...

{
  "ui:field": "LayoutGridField",
  "ui:layoutGrid": {
    "ui:row": {
      "spacing": 2,
      "children": [
        {
          "ui:col": {
            "size": 12,
            "children": [
              "example"
            ]
          }
        },
        {
          "ui:columns": {
            "size": 4,
            "children": [
              {
                "name": "example.0.0",
                "fullWidth": true
              },
              {
                "name": "example.0.1",
                "fullWidth": true
              },
              {
                "name": "example.0.2",
                "fullWidth": true
              }
            ]
          }
        }
      ]
    }
  },
  "example": {
    "ui:field": "LayoutHeaderField"
  }
}

One gets the following UI:

Screenshot 2025-08-15 at 5 38 39 PM

Checklist

  • I'm updating documentation
  • I'm adding or updating code
    • I've added and/or updated tests. I've run npx nx run-many --target=build --exclude=@rjsf/docs && npm run test:update to update snapshots, if needed.
    • I've updated docs if needed
    • I've updated the changelog with a description of the PR
  • I'm adding a new feature
    • I've updated the playground with an example use of the feature

expect(retrieveSchemaSpy).toHaveBeenCalledTimes(2);
expect(toIdSchemaSpy).not.toHaveBeenCalled();
});
test('returns schema, isRequired: true, isReadonly: true, options: undefined when selecting readonly field', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test title is also not accurate

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, copy pasta

Fixes rjsf-team#4676 by adding support for indexes into the `LayoutGridField`
- Updated `LayoutGridField` to add support for arrays
- Updated the `LayoutGridField` to add 100% validation for the new arrays code
@heath-freenome heath-freenome merged commit 2140a03 into rjsf-team:main Aug 18, 2025
4 checks passed
@heath-freenome heath-freenome deleted the fix-4676 branch August 18, 2025 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Using LayoutGridField for an array instead of an object

2 participants