Allow item name/label to be passed to 'Add item' or 'Remove' buttons #4424
Labels
feature
Is a feature request
needs triage
Initial label given, to be assigned correct labels and assigned
Prerequisites
What theme are you using?
bootstrap-4
Is your feature request related to a problem? Please describe.
I have a schema that looks like:
Using the bootstrap-4 theme as an example (using the https://rjsf-team.github.io/react-jsonschema-form/ playground), after I add a file, a 'Remove' button appears next to the Keywords field. This is simply a coincidence due to the schema layout, but makes it appear that the remove button is associated with the Keywords field (which it is not). The remove button, when hovered over simply says 'Remove' without any qualifier as to 'What' it is removing (see screenshot below).
I read through https://rjsf-team.github.io/react-jsonschema-form/docs/advanced-customization/internals/#custom-array-field-buttons and it seems that these labels are controlled by CSS, but the javascript themes seem to mostly reference
<IconButton title={translateString(TranslatableString.RemoveButton)}
which uses the enumerated constant TranslatableString to define the 'title' of the button.Describe the solution you'd like
It would be helpful if the item label could be passed to the title of the 'Remove' button and 'Add' button. So in the case above where the Remove button is for the file, it would be nice if the Remove button title read something like 'Remove Files-0'. And instead of the Keywords 'Add' button having a title of 'Add item' it would read 'Add Keywords'.
I'm guessing the buttons could possibly read the 'label' from the widgets as mentioned in
react-jsonschema-form/CHANGELOG.md
Line 1101 in 5335d72
Describe alternatives you've considered
No response
The text was updated successfully, but these errors were encountered: