appsmithorg / appsmith

Platform to build admin panels, internal tools, and dashboards. Integrates with 25+ databases and any API.
https://www.appsmith.com
Apache License 2.0
34.8k stars 3.77k forks source link

[Bug]-[20]:File-picker button still shows old value in the following scenario #14042

Open btsgh opened 2 years ago

btsgh commented 2 years ago

Is there an existing issue for this?

Description

When, in a file picker, I bind the visible property of the widget to a checkbox. Now, on deploy, I choose say 5 files. Then uncheck the visible property.. The file-picker disappears.. Now, when I check the visible property checkbox, the file picker button still reads as 5 files selected, but in the file picker modal, there are no files listed. On browsing again, and choosing say 2 files, the number on the button adds up to the above 7, though there are only 2 chosen.

Steps To Reproduce

  1. Add a file picker widget to the canvas.
  2. Bind its Visible property to a checkbox. (If checked = true, else = false)
  3. Maximum number of files, give a limit of say 10.
  4. Deploy the app. Now select say 5 files in the file picker and click upload.
  5. Uncheck the box to make the file-picker widget invisible.
  6. Again check it to make it visible. Now it is seen that the number on the button indicates 5 files selected. However, on clicking the button, the modal shows up empty. If we select two files in the modal and upload, it shows 7 files selected, though only two were selected from the modal.

LOOM DEMO

Public Sample App

No response

Version

Production

dilippitchika commented 2 years ago

Valid issue, happens when the filepicker is hidden. Unsure about reach, but assuming people who have marked filepicker's isVisible. Looking at data where it's js controlled i found roughly 10 unique values where this can happen

Stats

Stat Values
Reach 10
Effort (months) 0.5