Skip to content

Commit 495cf93

Browse files
tilboernercodingjoe
authored andcommitted
Remove submit logic from click event handler (#79)
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.
1 parent 7e7656d commit 495cf93

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

s3file/static/s3file/js/s3file.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,13 @@
8080
}
8181

8282
function clickSubmit (e) {
83-
e.preventDefault()
8483
let submitButton = e.target
8584
let form = submitButton.closest('form')
8685
const submitInput = document.createElement('input')
8786
submitInput.type = 'hidden'
8887
submitInput.value = submitButton.value || true
8988
submitInput.name = submitButton.name
9089
form.appendChild(submitInput)
91-
uploadS3Inputs(form)
9290
}
9391

9492
function uploadS3Inputs (form) {

0 commit comments

Comments
 (0)