Stirling-PDF icon indicating copy to clipboard operation
Stirling-PDF copied to clipboard

fix: show only selected files for merge tool

Open michelheusschen opened this issue 1 year ago • 0 comments

The merge PDF tool incorrectly displays the list of selected files when files are selected one after one. To reproduce:

  1. Go to /merge-pdfs
  2. Select one file using either the file input or drag & drop
  3. Select a second file using either the file input or drag & drop

There are two possible problems that can occur, depending if file input or drag & drop was used:

  • File input: both files are listed, however the first file is no longer selected
  • Drag & drop: the second file is listed twice

The issue is fixed by clearing the list of selected files, before appending the selected files to the #selectedFiles element. Also fixes #660 and fixes #671, these have the same underlying issue.

License Agreement for Contributions

By submitting this pull request, I acknowledge and agree that my contributions will be included in Stirling-PDF and that they can be relicensed in the future under MPL 2.0 (Mozilla Public License Version 2.0) license.

(This does not change the general open-source nature of Stirling-PDF, simply moving from one license to another license)

michelheusschen avatar Jan 23 '24 15:01 michelheusschen