From 8bb9e5b22f46fd66397489f477aefa013cd78034 Mon Sep 17 00:00:00 2001 From: Anthony Stirling <77850077+Frooodle@users.noreply.github.com> Date: Sun, 6 Aug 2023 14:16:56 +0100 Subject: [PATCH] Update fileInput.js --- src/main/resources/static/js/fileInput.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/resources/static/js/fileInput.js b/src/main/resources/static/js/fileInput.js index 9379a7bf..7825af8b 100644 --- a/src/main/resources/static/js/fileInput.js +++ b/src/main/resources/static/js/fileInput.js @@ -80,9 +80,10 @@ function setupFileInput(chooser) { document.body.addEventListener('dragleave', dragleaveListener); document.body.addEventListener('drop', dropListener); - $("#" + elementId).on("change", function() { - handleFileInputChange(this); - }); + $("#" + elementId).on("change", function(e) { + allFiles = Array.from(e.target.files); + handleFileInputChange(this); + }); function handleFileInputChange(inputElement) { const files = allFiles;