react-admin icon indicating copy to clipboard operation
react-admin copied to clipboard

Added emptyText to SelectArrayInput component

Open Tomas025 opened this issue 10 months ago • 3 comments

Problem

Absence of the emptyText property in the SelectArrayInput component #10454

Solution

The empty Text property was added to the component, the emptyText option clears all fields that had been selected

How To Test

It is possible to view the update in the storybook

Additional Checks

  • [ ✓ ] The PR targets master for a bugfix, 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.

Tomas025 avatar Feb 08 '25 19:02 Tomas025

I'm -1 for this feature. The right UI for clearing a select input is a clear button, not a clear option.

image

MUI has a discussion and instructions for implementing this in user land:

https://github.com/mui/material-ui/issues/27141

fzaninotto avatar Feb 11 '25 09:02 fzaninotto

I agree that it makes more sense a clear button, but I tried to replicate the way it was in <SelectInput> and I also realized that it <NullableBooleanInput> is also that way with an empty field in the choices

Tomas025 avatar Feb 11 '25 14:02 Tomas025

I agree that it makes more sense a clear button, but I tried to replicate the way it was in <SelectInput> and I also realized that it <NullableBooleanInput> is also that way with an empty field in the choices

I understand your reasonning, and it makes sense. However, for new features, we look for the best balance between intuitive DX and good UX. In this case, I think the balance clearly points to a clear button as adornment.

fzaninotto avatar Feb 12 '25 13:02 fzaninotto