From 649cacfa05e9d127a8906637e8a71d5dffffc88b Mon Sep 17 00:00:00 2001 From: william-napitupulu <121214479+william-napitupulu@users.noreply.github.com> Date: Tue, 2 Jun 2026 09:47:25 +0700 Subject: [PATCH] Importing files bug (#582) * Update Styles.css Small update to the styles that bothered me, i noticed in the window/modal for calendar when editing a day the time icons had a mask that overlapped the icon. I simply added 'background-image: none' prop to it/ * Importing files bug I found a bug that wouldn't let me upload files in the library window during the documents tab, when a user selected a file, the code grabbed a reference to fileInput.files and immediately cleared the input value (fileInput.value = '') to allow for re-uploading the same file later. However, because fileInput.files is a live FileList tied directly to the DOM element, clearing the input inherently emptied our saved variable as well, resulting in lost file data. Note this error might be browser specific as it worked fine on Zen/Firefox but failed on Edge and chrome Fix use Array.From which copies the value into files instead of using refrences --- static/js/documentLibrary.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/js/documentLibrary.js b/static/js/documentLibrary.js index 64c0f9e..d7b9861 100644 --- a/static/js/documentLibrary.js +++ b/static/js/documentLibrary.js @@ -3130,7 +3130,7 @@ let _libraryArchivedView = false; // Documents tab showing archived docs? importFileBtn.addEventListener('click', () => fileInput.click()); fileInput.addEventListener('change', async () => { if (fileInput.files.length === 0) return; - const files = fileInput.files; + const files = Array.from(fileInput.files); fileInput.value = ''; // Swap the import icon for a whirlpool while files upload. const _orig = importFileBtn.innerHTML;