Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Commit ea053b1

Browse files
revert(typeahead): prevent accidental form submission on ENTER
Closes #1298 This reverts commit 253c49f.
1 parent dd415a9 commit ea053b1

File tree

2 files changed

+0
-11
lines changed

2 files changed

+0
-11
lines changed

Diff for: src/typeahead/test/typeahead.spec.js

-8
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ describe('typeahead tests', function () {
6060
var e = $.Event("keydown");
6161
e.which = keyCode;
6262
inputEl.trigger(e);
63-
return e;
6463
};
6564

6665
//custom matchers
@@ -439,13 +438,6 @@ describe('typeahead tests', function () {
439438
expect($scope.isLoading).toBeFalsy();
440439
});
441440

442-
it('pr 1165 - prevent default on ENTER to avoid accidental form submission', function () {
443-
var element = prepareInputEl("<div><input ng-model='result' typeahead='item for item in source | filter:$viewValue'></div>");
444-
var e = triggerKeyDown(element, 13);
445-
446-
expect(e.isDefaultPrevented()).toBeTruthy();
447-
});
448-
449441
it('does not close matches popup on click in input', function () {
450442
var element = prepareInputEl("<div><input ng-model='result' typeahead='item for item in source | filter:$viewValue'></div>");
451443
var inputEl = findInput(element);

Diff for: src/typeahead/typeahead.js

-3
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,6 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position', 'ui.bootstrap
230230

231231
//typeahead is open and an "interesting" key was pressed
232232
if (scope.matches.length === 0 || HOT_KEYS.indexOf(evt.which) === -1) {
233-
if (evt.which === 13) {
234-
evt.preventDefault();
235-
}
236233
return;
237234
}
238235

0 commit comments

Comments
 (0)