Skip to content

Commit 24539c9

Browse files
committed
Improve handling of submit buttons when determining when to preventDefault to avoid navigation.
Only preventDefault on click events of submit buttons, not *all* events. I want to remove handling of submit buttons altogether (letting the form submit event be prevented, instead), but fear that this line was put in here to solve a specific case in some buggy browser.
1 parent 1b6d0c3 commit 24539c9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/plugin-base/on.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ define(function (require) {
237237
nodeType = node.type && node.type.toLowerCase();
238238
// catch links and submit buttons/inputs in forms
239239
isNavEvent = ('click' == e.type && 'A' == nodeName)
240-
|| ('submit' == nodeType && node.form)
240+
|| ('click' == e.type && 'submit' == nodeType && node.form)
241241
|| ('submit' == e.type && 'FORM' == nodeName);
242242
if (isNavEvent) {
243243
preventDefaultAlways(e);

0 commit comments

Comments
 (0)