aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/bg/js/search.js7
-rw-r--r--ext/mixed/js/display.js2
2 files changed, 9 insertions, 0 deletions
diff --git a/ext/bg/js/search.js b/ext/bg/js/search.js
index 431478c9..5c0bffed 100644
--- a/ext/bg/js/search.js
+++ b/ext/bg/js/search.js
@@ -79,6 +79,7 @@ class DisplaySearch extends Display {
onSearchInput() {
this.updateSearchButton();
+ this.query.scrollIntoView();
}
onSearch(e) {
@@ -94,6 +95,12 @@ class DisplaySearch extends Display {
this.onSearchQueryUpdated(query, true);
}
+ onKeyDown(e) {
+ if (!super.onKeyDown(e)) {
+ this.query.focus({preventScroll: true});
+ }
+ }
+
async onSearchQueryUpdated(query, animate) {
try {
const valid = (query.length > 0);
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js
index b40228b0..bdc5e962 100644
--- a/ext/mixed/js/display.js
+++ b/ext/mixed/js/display.js
@@ -157,8 +157,10 @@ class Display {
const handler = handlers[key];
if (handler(this, e)) {
e.preventDefault();
+ return true;
}
}
+ return false;
}
onWheel(e) {