Skip to content

Commit

Permalink
Bug 370969 - Using the Browse for file button on a dialog with the ke…
Browse files Browse the repository at this point in the history
…yboard submits the dialog
  • Loading branch information
Max Li committed Feb 8, 2012
1 parent a6da5e3 commit 8b00419
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ dojo.declare("orion.widgets.ImportDialog", [ dijit.Dialog, orion.widgets._OrionD
this.options.func();
}), 2000);
}));

// Stop the dialog from submitting if trying to activate the upload button with a keyboard.
// See https://bugs.eclipse.org/bugs/show_bug.cgi?id=370969

dojo.connect(dijit.byId("importDialog.uploader"), "onKeyPress", function(evt) {
if(evt.keyCode === dojo.keys.ENTER) {
evt.stopPropagation();
}
});
}
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@ dojo.declare("orion.git.widgets.ApplyPatchDialog", [ dijit.Dialog, orion.widgets
this.hide();
}), 2000);
}));

// Stop the dialog from submitting if trying to activate the upload button with a keyboard.
// See https://bugs.eclipse.org/bugs/show_bug.cgi?id=370969

dojo.connect(dijit.byId("applyPatchDialog.uploader"), "onKeyPress", function(evt) {
if(evt.keyCode === dojo.keys.ENTER) {
evt.stopPropagation();
}
});
}
});
});

0 comments on commit 8b00419

Please sign in to comment.