mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-06 08:22:24 +01:00
fix (skiplink): edge case with empty folder
This commit is contained in:
parent
9e41d0c97f
commit
03a1b0f57a
1 changed files with 2 additions and 1 deletions
|
|
@ -47,7 +47,8 @@ export default WithShell(function(render) {
|
||||||
const $skip = createElement(`<a aria-role="navigation" href="#main">${t("Skip to content")}</a>`);
|
const $skip = createElement(`<a aria-role="navigation" href="#main">${t("Skip to content")}</a>`);
|
||||||
$skip.onclick = (e) => {
|
$skip.onclick = (e) => {
|
||||||
e.preventDefault();
|
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);
|
document.body.prepend($skip);
|
||||||
onDestroy(() => $skip.remove());
|
onDestroy(() => $skip.remove());
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue