Skip to content

Commit 8f6f157

Browse files
committed
Merge pull request #23 from XiXora/patch-1
Fixed browser back behaviour when removing queries
2 parents 4e69a7f + 8b1b580 commit 8f6f157

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/angular-advanced-searchbox.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,10 @@ angular.module('angular-advanced-searchbox', [])
171171
var cursorPosition = getCurrentCaretPosition(e.target);
172172

173173
if (e.which == 8) { // backspace
174-
if (cursorPosition === 0)
174+
if (cursorPosition === 0) {
175+
e.preventDefault();
175176
$scope.editPrevious(searchParamIndex);
177+
}
176178

177179
} else if (e.which == 9) { // tab
178180
if (e.shiftKey) {

0 commit comments

Comments
 (0)