Skip to content

[FileUpload, FileDropzone]: rename validateIndividually and change maxSize to bytes #889

Description

@ly-tempel-bitweb

Problem

  1. validateIndividually JSDoc is incorrect. use-file-upload.ts:51 says "each file is validated separately instead of rejecting all at once." Validation is per-file regardless, and without the flag the batch isn't rejected, valid files still land. It actually means "keep rejected files in the list instead of discarding them", and it's ignored entirely unless multiple is set.
    Also, consider renaming it to something like keepRejectedFiles.
  2. Change maxSize to bytes. maxSize is in megabytes (use-file-upload.ts:40-42). Every comparable library takes bytes:
  • react-dropzone (Maximum file size (in bytes)),
  • PrimeNG maxFileSize,
  • Vuetify,
  • Syncfusion
  • DevExtreme,
  • Kendo

As does TEDI's own community tedi-file-dropzone, which additionally grew a
sizeDisplayStandard: "SI" | "IEC" input because of the MB/MiB ambiguity MB invites.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

tedi-readyTEDI-Ready component issue

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions