Skip to content

An alternative for TextArrayInput using react-admin v5.3 #10456

@HeitorMC

Description

@HeitorMC

I need to use the TextArrayInput component; however, I've realized that it is only available in version 5.5, and I am currently on version 5.3. Unfortunately, we cannot update to the minor version at this time. Is there an alternative for this?

I've been trying to implement a solution using the Autocomplete component as follows:

<Autocomplete
  clearIcon={false}
  options={[]}
  freeSolo
  multiple
  value={parsedEmails.supportContactStackCommerce}
  onChange={handleEmailChange('supportContactStackCommerce')}
  renderTags={(value, props) =>
    value.map((option, index) => (
      <Chip key={index} label={option} {...props({ index })} />
    ))
  }
  renderInput={(params) => (
    <TextField
      {...params}
      label="Support Contact (StackCommerce)"
      helperText="Add emails"
    />
  )}
  fullWidth
/>

However, this approach is not working properly with SimpleForm because it doesn't recognize changes for this specific field.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions