Avoid js error when no menu items exist.
This commit is contained in:
parent
b0bb12afdb
commit
2a38980dbe
1 changed files with 4 additions and 2 deletions
|
|
@ -55,7 +55,9 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
// Move focus back to button efter user tab out of last link.
|
// Move focus back to button efter user tab out of last link.
|
||||||
const lastlink = [].slice.call(links).pop();
|
if (links.length) {
|
||||||
lastlink.addEventListener('blur', () => toggle.focus());
|
const lastlink = [].slice.call(links).pop();
|
||||||
|
lastlink.addEventListener('blur', () => toggle.focus());
|
||||||
|
}
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue