saas-js / saas-ui

The React component library for startups, built with Chakra UI.
https://saas-ui.dev
MIT License
1.32k stars 128 forks source link

FileUpload component doesnt show filename if accept = "*" #193

Closed jleuth closed 8 months ago

jleuth commented 8 months ago

I found a bug where if you allow any item instead of certain filetype(s) it will not show the filename to be uploaded.

Using code: `<FileUpload maxFileSize={26214400} accept="audio/mp3,audio/mp4,audio/mpeg,audio/mpga,audio/m4a,audio/wav,audio/webm" {...rest} onFilesChange={(files) => { if (files.acceptedFiles?.length) { onChange(files.acceptedFiles[0]) } }} maxFiles={1} inputRef={ref}

`

image

Using code: `<FileUpload maxFileSize={26214400} accept="*" {...rest} onFilesChange={(files) => { if (files.acceptedFiles?.length) { onChange(files.acceptedFiles[0]) } }} maxFiles={1} inputRef={ref}

`

image

As you can see, when a file is ready to be uploaded, nothing is shown.

linear[bot] commented 8 months ago

SUI-384 FileUpload component doesnt show filename if accept = "*"

jleuth commented 8 months ago

Nevermind, I'm an idiot. I didn't know it had to be "/" instead of just ""