Skip to content
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

Closed
Tracked by #7860
MwSpaceLLC opened this issue Jun 20, 2020 · 14 comments

Comments

@MwSpaceLLC
Copy link

Hi there,

We can't render correct number at files:

image

@MwSpaceLLC
Copy link
Author

File uploader reset file selection automaticly,

U must remove old item with onDelete={()=>{}}

@MwSpaceLLC
Copy link
Author

Not work propery

@MwSpaceLLC MwSpaceLLC reopened this Jun 20, 2020
@MwSpaceLLC
Copy link
Author

Is very difficult to learn how to manage file list multiple.

When we user change file, the list not update

image

@MwSpaceLLC
Copy link
Author

MwSpaceLLC commented Jun 20, 2020

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

image

@MwSpaceLLC MwSpaceLLC changed the title File uploader count files | Not work File uploader multiple files | Not work listed items Jun 20, 2020
@MwSpaceLLC MwSpaceLLC changed the title File uploader multiple files | Not work listed items 𝙵𝚒𝚕𝚎 𝚞𝚙𝚕𝚘𝚊𝚍𝚎𝚛 𝚖𝚞𝚕𝚝𝚒𝚙𝚕𝚎 𝚏𝚒𝚕𝚎𝚜 | 𝙽𝚘𝚝 𝚠𝚘𝚛𝚔 𝚕𝚒𝚜𝚝𝚎𝚍 𝚒𝚝𝚎𝚖𝚜 Jun 20, 2020
@MwSpaceLLC MwSpaceLLC changed the title 𝙵𝚒𝚕𝚎 𝚞𝚙𝚕𝚘𝚊𝚍𝚎𝚛 𝚖𝚞𝚕𝚝𝚒𝚙𝚕𝚎 𝚏𝚒𝚕𝚎𝚜 | 𝙽𝚘𝚝 𝚠𝚘𝚛𝚔 𝚕𝚒𝚜𝚝𝚎𝚍 𝚒𝚝𝚎𝚖𝚜 𝔽𝕚𝕝𝕖 𝕦𝕡𝕝𝕠𝕒𝕕𝕖𝕣 𝕞𝕦𝕝𝕥𝕚𝕡𝕝𝕖 𝕗𝕚𝕝𝕖𝕤 | ℕ𝕠𝕥 𝕨𝕠𝕣𝕜 𝕝𝕚𝕤𝕥𝕖𝕕 𝕚𝕥𝕖𝕞𝕤 Jun 20, 2020
@MwSpaceLLC MwSpaceLLC changed the title 𝔽𝕚𝕝𝕖 𝕦𝕡𝕝𝕠𝕒𝕕𝕖𝕣 𝕞𝕦𝕝𝕥𝕚𝕡𝕝𝕖 𝕗𝕚𝕝𝕖𝕤 | ℕ𝕠𝕥 𝕨𝕠𝕣𝕜 𝕝𝕚𝕤𝕥𝕖𝕕 𝕚𝕥𝕖𝕞𝕤 𝐅𝐢𝐥𝐞 𝐮𝐩𝐥𝐨𝐚𝐝𝐞𝐫 𝐦𝐮𝐥𝐭𝐢𝐩𝐥𝐞 𝐟𝐢𝐥𝐞𝐬 | 𝐍𝐨𝐭 𝐰𝐨𝐫𝐤 𝐥𝐢𝐬𝐭𝐞𝐝 𝐢𝐭𝐞𝐦𝐬 Jun 20, 2020
@MwSpaceLLC MwSpaceLLC changed the title 𝐅𝐢𝐥𝐞 𝐮𝐩𝐥𝐨𝐚𝐝𝐞𝐫 𝐦𝐮𝐥𝐭𝐢𝐩𝐥𝐞 𝐟𝐢𝐥𝐞𝐬 | 𝐍𝐨𝐭 𝐰𝐨𝐫𝐤 𝐥𝐢𝐬𝐭𝐞𝐝 𝐢𝐭𝐞𝐦𝐬 𝗙𝗶𝗹𝗲 𝘂𝗽𝗹𝗼𝗮𝗱𝗲𝗿 𝗺𝘂𝗹𝘁𝗶𝗽𝗹𝗲 𝗳𝗶𝗹𝗲𝘀 | 𝗡𝗼𝘁 𝘄𝗼𝗿𝗸 𝗹𝗶𝘀𝘁𝗲𝗱 𝗶𝘁𝗲𝗺𝘀 Jun 20, 2020
@dudley-ibm
Copy link
Contributor

Could you please clarify? I'm not sure which file nor from which pull request this issue arose.

@MwSpaceLLC
Copy link
Author

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.

@emyarod
Copy link
Member

emyarod commented Jun 22, 2020

can you create a reduced test case in Code Sandbox for easier testing and debugging?

@MwSpaceLLC
Copy link
Author

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.

image

This simple return in onChangeFileTrigger function alweys last files but not all.

@MwSpaceLLC
Copy link
Author

Hi there,

We have found another issue in this component.

When u attach in 2/3 times many file. If user add files with same name, when clicl on delete, the component delete all item with same name.

I think this is no correct, because the iterator must be a univoque id for item deleted.

image

@emyarod
Copy link
Member

emyarod commented Jun 23, 2020

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?

@MwSpaceLLC
Copy link
Author

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.

ibm-files

@MwSpaceLLC
Copy link
Author

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.

@emyarod
Copy link
Member

emyarod commented Feb 23, 2021

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

https://codesandbox.io/s/github/carbon-design-system/carbon/tree/master/packages/react/examples/drag-and-drop-file-uploader

@emyarod emyarod closed this as completed Feb 23, 2021
@MwSpaceLLC
Copy link
Author

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

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

No branches or pull requests

4 participants