diff options
author | Scott Main <smain@google.com> | 2010-01-25 14:38:43 -0800 |
---|---|---|
committer | Scott Main <smain@google.com> | 2010-01-25 15:26:10 -0800 |
commit | 9033c1268889c8561d4d5ea0e0836079d7c31a94 (patch) | |
tree | aa9409522dbc2757b9cceb78ea2b9d85c64d5fdb /tools/droiddoc/templates | |
parent | 945ed36ec486f83c4546cac8d6bed954dfe32c4e (diff) | |
download | build-9033c1268889c8561d4d5ea0e0836079d7c31a94.zip build-9033c1268889c8561d4d5ea0e0836079d7c31a94.tar.gz build-9033c1268889c8561d4d5ea0e0836079d7c31a94.tar.bz2 |
docs: accept the enter key on key-down, rather than key-up,
in order to be sure we capture this key before anything else.
Fixes case where highlighted suggestions don't get executed
when pressed.
Bug: 1909300
Diffstat (limited to 'tools/droiddoc/templates')
-rw-r--r-- | tools/droiddoc/templates/assets/search_autocomplete.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/droiddoc/templates/assets/search_autocomplete.js b/tools/droiddoc/templates/assets/search_autocomplete.js index 086674a..4fa47a5 100644 --- a/tools/droiddoc/templates/assets/search_autocomplete.js +++ b/tools/droiddoc/templates/assets/search_autocomplete.js @@ -107,11 +107,13 @@ function search_changed(e, kd, toroot) var text = search.value; // 13 = enter - if (!kd && (e.keyCode == 13)) { + if (e.keyCode == 13) { document.getElementById("search_filtered_div").className = "no-display"; - if (gSelectedIndex >= 0) { + if (kd && gSelectedIndex >= 0) { window.location = toroot + gMatches[gSelectedIndex].link; return false; + } else if (gSelectedIndex < 0) { + return true; } } // 38 -- arrow up |