diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 10dd1fa134..c2c0482149 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -10,14 +10,14 @@ "rollForward": false }, "fantomas": { - "version": "8.0.0-beta-001", + "version": "8.0.0-beta-003", "commands": [ "fantomas" ], "rollForward": false }, "fsdocs-tool": { - "version": "23.0.0-alpha.1", + "version": "23.0.0-alpha.4", "commands": [ "fsdocs" ], @@ -38,4 +38,4 @@ "rollForward": false } } -} +} \ No newline at end of file diff --git a/docs/_body.html b/docs/_body.html index 8793272d6c..7f888857dd 100644 --- a/docs/_body.html +++ b/docs/_body.html @@ -3,7 +3,23 @@ menuHeaders.forEach(nv => { nv.addEventListener("click", () => { nv.classList.toggle("active"); - }) + }); + // A link in a folded section can still receive the focus, from Tab or from the j / k + // hotkeys of fsdocs. Unfold the section so the reader sees where the focus went. + const items = nv.nextElementSibling; + items?.addEventListener("focusin", ev => { + if (nv.classList.contains("active")) return; + nv.classList.add("active"); + // The section grows over its transition, and a scroll made while it was still folded + // could not reach a link below the folded height. Scroll again once it is fully open. + const link = ev.target; + const unfolded = e => { + if (e.target !== items) return; + items.removeEventListener("transitionend", unfolded); + link.scrollIntoView({ block: "nearest" }); + }; + items.addEventListener("transitionend", unfolded); + }); })