files-ui / files-ui-react

UI components for file uploads with React js. Files UI is a complete library for handling files in the UI. You can validate and upload them. Multilanguage. Server side support.
https://www.files-ui.com
MIT License
46 stars 9 forks source link

Add `title` and `aria-*` options to ActionButtonItem #30

Open TimmFitschen opened 11 months ago

TimmFitschen commented 11 months ago

Is your feature request related to a problem? Please describe.

Currently, actionButtons are not following modern best practices for a11y (accessibility), especially WAI-ARIA out of the box and do not allow to specify the title or aria attributes manually.

Describe the solution you'd like

Add title the option explicitly and allow aria-* attributes to be passed on to the button element.

<Dropzone 
  actionButtons={{
    uploadButton: {
      ariaLabel: "Click here to upload the selected files."
      title="Click here to upload the selected files."
    }
  }}/> 

Describe alternatives you've considered

Providing good defaults first and add the customization later - however, this is much more effort and defaults should be chosen carefully. So I think customization first and defaults later is better in this case.

TimmFitschen commented 11 months ago

I could provide an implementation if you want, @JinSSJ3 .