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

FileUpload - Expose Dropzone Error Types

Open andrewballantyne opened this issue 8 months ago • 4 comments

Is this a new component or an extension of an existing one? Existing component: FileUpload

Describe the feature Hey! Is there anyway to get access to Dropzone’s ErrorCode enum in TypeScript for when it rejects a drag and drop and you want to look for a specific error?

Eg. Using the FileUpload Component & providing this prop:

dropzoneProps={{
  onDropRejected: (rejections) => {
    const error = rejections[0].errors[0];
    if (error.code === ErrorCode.FileTooLarge) {
...

Are there visuals for this feature? If applicable, please include examples for each state and for varying widths N/A

Any other information?

Exposing internals of dropzone but making it difficult to write app layers against it feels like a bug more than a feature request -- but I figured this is at min a valid feature request.

andrewballantyne avatar Jun 04 '24 14:06 andrewballantyne