dxc-technology / halstack-react

Library of components for building SPAs with React and Halstack Design System
https://developer.dxc.com/halstack/
Apache License 2.0
15 stars 14 forks source link

Selecting same files in FileInput shows duplicates #1736

Closed diwakarang closed 8 months ago

diwakarang commented 10 months ago

Describe the bug In case of Multiple file selected, when a particular file is selected, and user trying to select another but accidentally selects the same file, it is now shown twice in the preview list. Instead it should be shown only once, since it is just a duplicate.

To Reproduce

  1. Enable FileInput component in the UI App.
  2. Click FileInput Component, and chose a File say FileA.
  3. Now FileA is shown in the list.
  4. Now click open files, and select same file again.
  5. Now it can be noticed, same file is being listed twice.
  6. This seems like a erroneous behavior, since both files are from same path, however they are listed twice.
  7. It could be good, if this behavior is fixed.

Expected behaviour Only one file should be shown, if the same file is selected multiple times(multiple is set to true). test condition to Identify the same file might require analysis from cdk team. For eg, two files with same fileName, from two different locations, are not same files. So need to include those scenarios as well, during analysis.

Screenshots

image

Additional context For small list of files, this could be ok. But when user is selecting tens or hundreds of files, this will become a big problem in the overall User experience. It could lead to a potentially difficult to trace bug in the overall app.

Add labels DxcFileInput, fileInput, file, duplicate, v10.1.0

jsuarezgonz commented 10 months ago

Hi @diwakarang, we have added the bug to our backlog and will try to fix it as soon as possible.

Thank you for the feedback.

diwakarang commented 10 months ago

Hi @jsuarezgonz Thanks for the update.