From f8037188229e8d76733f0e36249091f8a363b8be Mon Sep 17 00:00:00 2001 From: luciajanikova <19lucia99@gmail.com> Date: Sat, 19 Oct 2024 20:01:45 +0200 Subject: [PATCH] Fix JS to accept files also on drag&drop --- app/javascript/controllers/dropzone_controller.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/javascript/controllers/dropzone_controller.js b/app/javascript/controllers/dropzone_controller.js index 8255a479..3c7667c8 100644 --- a/app/javascript/controllers/dropzone_controller.js +++ b/app/javascript/controllers/dropzone_controller.js @@ -30,7 +30,8 @@ export default class extends Controller { } handleFiles(files) { - fileList.innerHTML = ''; + const fileInput = document.getElementById('content[]'); + fileInput.files = files; for (const file of files) { const listItem = document.createElement('div');