Skip to content

Commit d3b56c2

Browse files
committed
Summary: Fix bug in enter-press handling in IPR search form
- Legacy-Id: 8925
1 parent b675c06 commit d3b56c2

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

static/facelift/js/ipr-search.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ $(document).ready(function() {
1414

1515
// make enter presses submit through the nearby button
1616
$("form.ipr-search input,select").keyup(function (e) {
17-
if (e.which == 13) {
18-
$(this).next('button[type=submit]').click();
17+
var submitButton = $(this).closest(".form-group").find('button[type=submit]');
18+
if (e.which == 13 && submitButton.length > 0) {
19+
submitButton.click();
1920
return false;
2021
} else {
2122
return true;

0 commit comments

Comments
 (0)