web menu: disable tabbings on webmenu and ignore tab on webmenu searchbox

This commit is contained in:
Gerome Matilla 2020-06-06 17:43:09 +08:00
parent 13b0c7c816
commit 44a903e59b

View File

@ -42,6 +42,7 @@ const populateWebMenu = () => {
var aWebLink = document.createElement('a');
aWebLink.className = 'webMenuLink';
aWebLink.href = url;
aWebLink.tabIndex = '-1';
// Create an outer div, child of li
let webItemDiv = document.createElement('div')
@ -319,6 +320,8 @@ webMenuSearchBox.onkeydown = (event) => {
if ((event.key === 'ArrowRight') || (event.key === 'ArrowDown') ||
(event.key === 'ArrowLeft') || (event.key === 'ArrowUp')) return;
if (event.key === 'Tab') return;
if (event.key === 'Enter' && webItemFocus) {
// Run the focused li's callback
webItemFocus.callback();