Skip to content

Introduce <TextArrayField> and use <TextArrayInput> / <TextArrayField> in guessers for scalar arrays - #10939

Merged
Madeorsk merged 5 commits into
nextfrom
editguesser-TextArrayInput
Sep 17, 2025
Merged

Madeorsk merged 5 commits into
nextfrom
editguesser-TextArrayInput

Conversation

@slax57

@slax57 slax57 commented Sep 15, 2025 •

Copy link
Copy Markdown
Contributor

Problem

EditGuesser assumes that every array is an array of objects. If we detect values that are scalar arrays, the guesser will use a TextInput, which is not correct.

Solution

Detect scalar arrays in introspection, and use:

  • TextArrayInput in EditGuesser
  • TextArrayField (a list of Chips in a Stack, to be invented) for ListGuesser and ShowGuesser

How To Test

Additional Checks

  • The PR targets master for a bugfix or a documentation fix, or next for a feature
  • The PR includes unit tests (if not possible, describe why)
  • The PR includes one or several stories (if not possible, describe why)
  • The documentation is up to date

Also, please make sure to read the contributing guidelines.

@slax57 slax57 changed the title Use TextArrayInput / TextArrayField in guessers for scalar arrays Introduce <TextArrayField> and use <TextArrayInput> / <TextArrayField> in guessers for scalar arrays Sep 16, 2025
@slax57 slax57 added RFR Ready For Review and removed WIP Work In Progress labels Sep 16, 2025
@Madeorsk
Madeorsk self-requested a review September 16, 2025 14:41

@Madeorsk Madeorsk left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Perfect ✨, I only have a tiny doc suggestion

Comment thread docs/TextArrayField.md Resolved
Comment thread docs/TextArrayField.md Resolved
Comment thread docs/TextArrayField.md Resolved
Co-authored-by: Madeorsk <matthieu@marmelab.com>
@Madeorsk Madeorsk added this to the 5.12.0 milestone Sep 17, 2025
@Madeorsk
Madeorsk merged commit 4d9fb1b into next Sep 17, 2025
2 checks passed
@Madeorsk
Madeorsk deleted the editguesser-TextArrayInput branch September 17, 2025 07:31
Comment thread docs/TextArrayField.md

The following props are available for `<TextArrayField>`:

| Prop | Type | Required | Description |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nitpick: the Required column is the second one in all prop tables, here it's the third. Also, we usually include a Default column.

@slax57 slax57 Sep 17, 2025 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

okay I'll change that on master
UPDATE: I mean on next

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done: d785636

This branch was successfully deployed

1 active deployment
Preview – react-admin-storybook — c518eb1e Deployed Sep 17, 2025 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RFR Ready For Review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants