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
This commit is contained in:
committed by
GitHub
parent
cb3d86608c
commit
649cacfa05
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user