Skip to content

Commit 4454c7c

Browse files
committed
refactor(defaultTheme): refine keyboard navigation utilities
1 parent 3aed204 commit 4454c7c

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/tpl/defaultTheme/frontend/index.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,6 @@
236236
}
237237

238238
function getFocusableSibling(container, isBackward, startA) {
239-
if (!container) {
240-
return
241-
}
242239
if (!startA) {
243240
startA = container.querySelector(':focus');
244241
}
@@ -281,11 +278,8 @@
281278
}
282279
}
283280

284-
var selectorFirstAvailLi = 'li:not(.' + classNone + '):not(.' + classHeader + ')';
285-
286281
function getFirstFocusableSibling(container) {
287-
var li = container.querySelector(selectorFirstAvailLi);
288-
var a = li && li.querySelector('a');
282+
var a = container.querySelector('li:not(.' + classNone + '):not(.' + classHeader + ') a');
289283
return a;
290284
}
291285

0 commit comments

Comments
 (0)