@@ -885,12 +885,12 @@ window.initSearch = function(rawSearchIndex) {
885
885
focusSearchResult ( ) ;
886
886
}
887
887
888
- // focus the first search result on the active tab, or the result that
888
+ // Focus the first search result on the active tab, or the result that
889
889
// was focused last time this tab was active.
890
890
function focusSearchResult ( ) {
891
891
var target = searchState . focusedByTab [ searchState . currentTab ] ||
892
- document . querySelectorAll ( ".search-results.active a" ) . item ( 0 ) ||
893
- document . querySelectorAll ( "#titles > button" ) . item ( searchState . currentTab ) ;
892
+ document . querySelectorAll ( ".search-results.active a" ) . item ( 0 ) ||
893
+ document . querySelectorAll ( "#titles > button" ) . item ( searchState . currentTab ) ;
894
894
if ( target ) {
895
895
target . focus ( ) ;
896
896
}
@@ -1076,6 +1076,8 @@ window.initSearch = function(rawSearchIndex) {
1076
1076
ret_others [ 0 ] + ret_in_args [ 0 ] + ret_returned [ 0 ] + "</div>" ;
1077
1077
1078
1078
search . innerHTML = output ;
1079
+ // Reset focused elements.
1080
+ searchState . focusedByTab = [ null , null , null ] ;
1079
1081
searchState . showResults ( search ) ;
1080
1082
var elems = document . getElementById ( "titles" ) . childNodes ;
1081
1083
elems [ 0 ] . onclick = function ( ) { printTab ( 0 ) ; } ;
@@ -1365,7 +1367,6 @@ window.initSearch = function(rawSearchIndex) {
1365
1367
if ( e . which === 38 ) { // up
1366
1368
var previous = document . activeElement . previousElementSibling ;
1367
1369
if ( previous ) {
1368
- console . log ( "previousElementSibling" , previous ) ;
1369
1370
previous . focus ( ) ;
1370
1371
} else {
1371
1372
searchState . focus ( ) ;
0 commit comments