Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Closes #1: Awesome Bar no longer adaptively learns selections

Instead of faking a RIGHT, which closes the popup and places the selected url in the urlbar, conditionally fake a DOWN to the first result, so the popup stays open and urlbar still gets the right url.
  • Loading branch information...
commit 06bfb1c3cbae68b1382b04943d620e4035516eb6 1 parent 3344c16
@Mardak authored
Showing with 8 additions and 4 deletions.
  1. +8 −4 lib/main.js
View
12 lib/main.js
@@ -125,10 +125,14 @@ watchWindows(function(window) {
return;
}
- // Pretend the user pressed right in the location bar which will cause
- // the selected index to be filled in. If the user has already pressed
- // down to some other selection, it'll just show the same value.
- controller.handleKeyNavigation(event.DOM_VK_RIGHT);
+ // For the auto-selected first result, act as if the user pressed down
+ // to select it so that 1) the urlbar will have the correct url so the
+ // enter handler works and 2) the adaptive learning code-path will
+ // correctly associate the user's input to the selected popup item.
+ if (popup.selectedIndex == 0) {
+ popup.selectedIndex = -1;
+ controller.handleKeyNavigation(event.DOM_VK_DOWN);
+ }
break;
}
}, false);
Please sign in to comment.
Something went wrong with that request. Please try again.