aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis-Maxime Piton <[email protected]>2023-03-10 18:19:58 +0100
committerGitHub <[email protected]>2023-03-10 11:19:58 -0600
commit25579aad7c6db5423524bc6c41b2b070d547054c (patch)
tree0cebd2c4b36d2012159e434b4bed64ba910ef1f5
parent24130a4e6361fa72f7d1062b5a2fef8ea3e31e17 (diff)
downloadbootstrap-25579aad7c6db5423524bc6c41b2b070d547054c.tar.xz
bootstrap-25579aad7c6db5423524bc6c41b2b070d547054c.zip
Fix (#38191)
Co-authored-by: Patrick H. Lauke <[email protected]>
-rw-r--r--site/content/docs/5.3/components/scrollspy.md2
-rw-r--r--site/layouts/_default/docs.html2
2 files changed, 2 insertions, 2 deletions
diff --git a/site/content/docs/5.3/components/scrollspy.md b/site/content/docs/5.3/components/scrollspy.md
index 4bb5978f3..d1abf75e3 100644
--- a/site/content/docs/5.3/components/scrollspy.md
+++ b/site/content/docs/5.3/components/scrollspy.md
@@ -12,7 +12,7 @@ Scrollspy toggles the `.active` class on anchor (`<a>`) elements when the elemen
- To start, scrollspy requires two things: a navigation, list group, or a simple set of links, plus a scrollable container. The scrollable container can be the `<body>` or a custom element with a set `height` and `overflow-y: scroll`.
-- On the scrollable container, add `data-bs-spy="scroll"` and `data-bs-target="#navId"` where `navId` is the unique `id` of the associated navigation. Be sure to also include a `tabindex="0"` to ensure keyboard access.
+- On the scrollable container, add `data-bs-spy="scroll"` and `data-bs-target="#navId"` where `navId` is the unique `id` of the associated navigation. If there is no focusable element inside the element, be sure to also include a `tabindex="0"` to ensure keyboard access.
- As you scroll the "spied" container, an `.active` class is added and removed from anchor links within the associated navigation. Links must have resolvable `id` targets, otherwise they're ignored. For example, a `<a href="#home">home</a>` must correspond to something in the DOM like `<div id="home"></div>`
diff --git a/site/layouts/_default/docs.html b/site/layouts/_default/docs.html
index ed23045a6..cbf06a554 100644
--- a/site/layouts/_default/docs.html
+++ b/site/layouts/_default/docs.html
@@ -1,4 +1,4 @@
-{{ define "body_override" }}<body tabindex="0"{{ if (eq .Page.Params.toc true) }} data-bs-spy="scroll" data-bs-target="#TableOfContents"{{ end }}>{{ end }}
+{{ define "body_override" }}<body{{ if (eq .Page.Params.toc true) }} data-bs-spy="scroll" data-bs-target="#TableOfContents"{{ end }}>{{ end }}
{{ define "main" }}
<div class="container-xxl bd-gutter mt-3 my-md-4 bd-layout">
<aside class="bd-sidebar">