File tree 2 files changed +29
-0
lines changed
librustdoc/html/static/js
2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -1491,6 +1491,7 @@ function initSearch(rawSearchIndex) {
1491
1491
const target = searchState . focusedByTab [ searchState . currentTab ] ||
1492
1492
document . querySelectorAll ( ".search-results.active a" ) . item ( 0 ) ||
1493
1493
document . querySelectorAll ( "#titles > button" ) . item ( searchState . currentTab ) ;
1494
+ searchState . focusedByTab [ searchState . currentTab ] = null ;
1494
1495
if ( target ) {
1495
1496
target . focus ( ) ;
1496
1497
}
Original file line number Diff line number Diff line change
1
+ // Checks that the search tab results work correctly with function signature syntax
2
+ // First, try a search-by-name
3
+ goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
4
+ write: (".search-input", "Foo")
5
+ // To be SURE that the search will be run.
6
+ press-key: 'Enter'
7
+ // Waiting for the search results to appear...
8
+ wait-for: "#titles"
9
+
10
+ // Now use the keyboard commands to switch to the third result.
11
+ press-key: "ArrowDown"
12
+ press-key: "ArrowDown"
13
+ press-key: "ArrowDown"
14
+ assert: ".search-results.active > a:focus:nth-of-type(3)"
15
+
16
+ // Now switch to the second tab, then back to the first one, then arrow back up.
17
+ press-key: "ArrowRight"
18
+ assert: ".search-results.active:nth-of-type(2) > a:focus:nth-of-type(1)"
19
+ press-key: "ArrowLeft"
20
+ assert: ".search-results.active:nth-of-type(1) > a:focus:nth-of-type(3)"
21
+ press-key: "ArrowUp"
22
+ assert: ".search-results.active > a:focus:nth-of-type(2)"
23
+ press-key: "ArrowUp"
24
+ assert: ".search-results.active > a:focus:nth-of-type(1)"
25
+ press-key: "ArrowUp"
26
+ assert: ".search-input:focus"
27
+ press-key: "ArrowDown"
28
+ assert: ".search-results.active > a:focus:nth-of-type(1)"
You can’t perform that action at this time.
0 commit comments