Remove keyup event listener for forms

Let the browser take care of when to do implicit submission.
This commit is contained in:
Behind The Math
2018-11-11 17:09:49 -05:00
parent 52fb3bf938
commit e577c53070
2 changed files with 0 additions and 30 deletions

View File

@@ -120,10 +120,4 @@ module.exports = function(el) {
on(el, "submit", function(event) {
formAction.call(that, el, event)
})
on(el, "keyup", function(event) {
if (event.keyCode === 13) {
formAction.call(that, el, event)
}
}.bind(this))
}

View File

@@ -99,30 +99,6 @@ tape("test options are not modified by attachForm", function(t) {
t.end()
})
tape("test submit triggered by keyboard", function(t) {
var form = document.createElement("form")
var pjax = {
options: {},
loadUrl: function() {
t.equal(form.getAttribute(attr), "submit", "triggering a internal link actually submits the form")
}
}
t.plan(2)
attachForm.call(pjax, form)
form.action = window.location.protocol + "//" + window.location.host + "/internal"
trigger(form, "keyup", {keyCode: 14})
t.equal(form.getAttribute(attr), "", "keycode other than 13 doesn't trigger anything")
trigger(form, "keyup", {keyCode: 13})
// see loadUrl defined above
t.end()
})
tape("test form elements parsed correctly", function(t) {
t.plan(1)