dev.app - File upload - unwanted delete button
Closed this issue · 5 comments
Noticed an additional/unwanted delete button when uploading files
Please check with this simple model
https://dev.app.spiff.status.im/process-models/misc:qa:forms:single-file-upload-in-items-test
https://test.app.spiff.status.im/process-models/misc:qa:forms:single-file-upload-in-items-test
We may have to override the FileWidget to this properly https://github.com/rjsf-team/react-jsonschema-form/blob/main/packages/core/src/components/widgets/FileWidget.tsx#L120
That way we can handle the layout and whether or not to display that button from there. Ideally we'd keep the button but it would be a little x
maybe to differentiate it from the array list remove.
We currently are already overriding the icon buttons but we have very little control there since the buttons are not passed very much info: https://github.com/sartography/spiff-arena/blob/main/spiffworkflow-frontend/src/rjsf/carbon_theme/IconButton/IconButton.tsx#L1
so previously there was a trash can icon for the items. but there wasn't otherwise a way to clear files you had previously selected in a form. so for example, if you had a list of items in a form, and each item allowed you to select a file and also type a name in a text box, there would have been no way to clear the file without also deleting the entire item, which would have included the name. when we upgraded react json schema form, they had fixed this by putting a trash can icon next to the file field. this is ultimately good and correct. but it is weird in the form linked on this ticket, because each item in the list only had one thing in it, the file field, so it sort of seemed like there was just a duplicate trash can icon. also the trash can icon on the file field was a weird choice and sort of looked bad. we have updated the icon to be a minus icon. hopefully it looks better now and this all makes sense.
Above issues seems to be fixed now