mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2025-10-28 12:16:48 +08:00
fix (skiplink): edge case with empty folder
This commit is contained in:
@ -47,7 +47,8 @@ export default WithShell(function(render) {
|
||||
const $skip = createElement(`<a aria-role="navigation" href="#main">${t("Skip to content")}</a>`);
|
||||
$skip.onclick = (e) => {
|
||||
e.preventDefault();
|
||||
assert.type(document.querySelector("main a"), window.HTMLElement).focus();
|
||||
const $content = document.querySelector("main a");
|
||||
if ($content) assert.type($content, HTMLElement).focus();
|
||||
};
|
||||
document.body.prepend($skip);
|
||||
onDestroy(() => $skip.remove());
|
||||
|
||||
Reference in New Issue
Block a user