Skip to content

Selecting same files in FileInput shows duplicates #1736

@diwakarang

Description

@diwakarang

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingjiraThis task is referenced in a story of Jira

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions