From ab6dbddcd5bc84c91ff6727d5f741a8f9813d913 Mon Sep 17 00:00:00 2001 From: Til Boerner Date: Fri, 9 Mar 2018 12:27:37 +0100 Subject: [PATCH] Remove submit logic from click event handler There is no need to have submit logic take place in the on click handler. It only deals with the mouse click event, *not* the submit event that will follow. Before this change, blocking the default action on the click event prevents a following submit event from taking place: `form.onsubmit` and other registered listeners waiting for a 'submit' will never be called. --- s3file/static/s3file/js/s3file.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/s3file/static/s3file/js/s3file.js b/s3file/static/s3file/js/s3file.js index 04952bc..72720b4 100644 --- a/s3file/static/s3file/js/s3file.js +++ b/s3file/static/s3file/js/s3file.js @@ -80,7 +80,6 @@ } function clickSubmit (e) { - e.preventDefault() let submitButton = e.target let form = submitButton.closest('form') const submitInput = document.createElement('input') @@ -88,7 +87,6 @@ submitInput.value = submitButton.value || true submitInput.name = submitButton.name form.appendChild(submitInput) - uploadS3Inputs(form) } function uploadS3Inputs (form) {