Restore tab index for linkless nav elements

This commit is contained in:
Florine W. Dekker 2022-11-24 18:17:47 +01:00
parent c71fab3342
commit 0be8fc9b97
Signed by: FWDekker
GPG Key ID: D3DCFAA8A4560BE0
2 changed files with 2 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@fwdekker/template",
"version": "3.3.8",
"version": "3.3.9",
"description": "The base template for pages on fwdekker.com.",
"author": "Florine W. Dekker",
"license": "MIT",

View File

@ -134,6 +134,7 @@ function unpackEntry(entry: any, parentPath: string = "/", highlightPath?: strin
const a = document.createElement("a");
a.innerText = entry.name;
a.tabIndex = 0;
if (hasChildren) {
const depth = parentPath.split("/").length - 2; // -1 because count parts, then another -1 because of leading /
a.innerText += ` ${depth === 0 ? "▾" : "▸"}`;