-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
𝗙𝗶𝗹𝗲 𝘂𝗽𝗹𝗼𝗮𝗱𝗲𝗿 𝗺𝘂𝗹𝘁𝗶𝗽𝗹𝗲 𝗳𝗶𝗹𝗲𝘀 | 𝗡𝗼𝘁 𝘄𝗼𝗿𝗸 𝗹𝗶𝘀𝘁𝗲𝗱 𝗶𝘁𝗲𝗺𝘀 #6321
Comments
File uploader reset file selection automaticly, U must remove old item with |
Not work propery |
Hi @dudley-ibm @joshblack @aledavila @tw15egan, If we add a file by opening the file manager after having previously inserted files, the system calculates in the input only the last selected file and does not delete the other files so we cannot understand how to make it work |
Could you please clarify? I'm not sure which file nor from which pull request this issue arose. |
Hi @dudley-ibm, thanks for reply. When we add the multiple file field to our project, you can choose for example 3/4 files and the component generates the div of the files (FileUploaderItem) and so far everything works. Aw we choose for example another file, another file uploader item is generated, but the total number of files is not increased. The content of all the files is reset and the input contains the last one entered dolefully. This creates confusion and we can't figure out how to solve the problem. |
can you create a reduced test case in Code Sandbox for easier testing and debugging? |
shure: https://codesandbox.io/s/morning-waterfall-fpivs?file=/src/index.js The file if u add files in 2/3 step, return only currenct select file and list not update and u lost old file selection. This simple return in onChangeFileTrigger function alweys last files but not all. |
thanks for the sandbox link, can you reduce the test case down further to contain only the relevant portions and provide a clearer description about the issue(s) and how to replicate them? |
shure @emyarod, u can find our example at https://codesandbox.io/s/elated-sky-56cqq?file=/src/index.js. The full explanation is easy, the total number of files in the input file is wrong. This input always returns the total of files selected incorrectly, as you can see if you select multiple files by opening the file manager of your computer several times. |
In the gif you can also see that the system deletes the selected file in a messy way by removing several files at the same time. |
these are all issues with your example application. you are overwriting the list of total files rather than adding them together https://codesandbox.io/s/strange-worker-bm92j?file=/src/index.js you are also not providing unique ids for your files so by default it uses names as identifiers. if you look at the example drag and drop file uploader application, you can see how the component is used |
Sorry for the inconvenience, it was an old development where we were just starting out with React. Surely today errors of this kind will not happen. Thanks for your patience |
Hi there,
We can't render correct number at files:
The text was updated successfully, but these errors were encountered: