mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2025-10-30 01:26:43 +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>`);
|
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());
|
||||||
|
|||||||
Reference in New Issue
Block a user