jpmorganchase / salt-ds

React UI components built with a focus on accessibility, customization and ease-of-use
https://www.saltdesignsystem.com
Apache License 2.0
125 stars 89 forks source link

FileDropZone component not picking same file after reset #3591

Closed shakeelss2009 closed 3 months ago

shakeelss2009 commented 3 months ago

Package name(s)

Core (@salt-ds/core)

Package version(s)

1.23.0

Description

Hi, The FileDropZone component isn't selecting previously selected file after reset, https://storybook.saltdesignsystem.com/?path=/story/core-file-drop-zone--default Steps to reproduce from above storybook sample,

  1. Browse for a file and select it. It shows message "Upload completed".
  2. Click on Reset button.
  3. Browse files and select the same file that was previously selected. Nothing happens.

We are using this component in a similar scenario where after selection, we show the selected file in a table and also have a "delete" option. So, when we delete the file and try to browse and select it again, we are unable to do so. Only workaround is to select a different file and then select the deleted file.

I know this behavior is due to the onChange event and event not being triggered on selecting same file. However, I believe it is also a bug and not the right user experience.

Steps to reproduce

The FileDropZone component isn't selecting previously selected file after reset, https://storybook.saltdesignsystem.com/?path=/story/core-file-drop-zone--default Steps to reproduce from above storybook sample,

  1. Browse for a file and select it. It shows message "Upload completed".
  2. Click on Reset button.
  3. Browse files and select the same file that was previously selected. Nothing happens.

Expected behavior

Select the file

Operating system

Browser

Are you a JPMorgan Chase & Co. employee?

origami-z commented 3 months ago

Workaround - adding event.target.value = null; within trigger's onChange should work.

Will look into incorporating this within component.

mark-tate commented 3 months ago

Zazu Goal: S(3)

origami-z commented 3 months ago

27 Jun - merged, will be in the next release