Skip to content

Commit ec10654

Browse files
authored
Merge pull request #13256 from quarto-dev/glin-fix-tabs
a11y: fix keyboard navigation for tabset panels in websites when using an HTML theme
2 parents c6987f7 + 69b0bcc commit ec10654

File tree

7 files changed

+51
-1
lines changed

7 files changed

+51
-1
lines changed

news/changelog-1.8.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ All changes included in 1.8:
6767

6868
### `website`
6969

70+
- ([#10284](https://github.com/quarto-dev/quarto-cli/issues/10284)): a11y - Fix keyboard navigation for tabset panels when using an HTML theme. Tabs now properly receive keyboard focus.
7071
- ([#12551](https://github.com/quarto-dev/quarto-cli/pull/12551)): Improve warning issued when `aliases` would overwrite an existing document.
7172
- ([#12616](https://github.com/quarto-dev/quarto-cli/issues/12616)): find SVG images in image discovery for listings.
7273
- ([#12693](https://github.com/quarto-dev/quarto-cli/issues/12693)): Prevent resource exhaustion on large websites by serializing `NotebookContext` information to file instead of the environment.

src/resources/filters/customnodes/panel-tabset.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ function bootstrapTabs()
286286
active = " active"
287287
selected = "true"
288288
end
289-
return 'class="nav-link' .. active .. '" id="' .. tablinkid .. '" data-bs-toggle="tab" data-bs-target="#' .. tabid .. '" role="tab" aria-controls="' .. tabid .. '" aria-selected="' .. selected .. '"'
289+
return 'class="nav-link' .. active .. '" id="' .. tablinkid .. '" data-bs-toggle="tab" data-bs-target="#' .. tabid .. '" role="tab" aria-controls="' .. tabid .. '" aria-selected="' .. selected .. '" href=""'
290290
end,
291291
paneAttribs = function(tabid, isActive, headingAttribs)
292292
local tablinkid = tabid .. "-tab"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/.quarto/
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
project:
2+
type: website
3+
4+
website:
5+
title: "issue-13233"
6+
navbar:
7+
left:
8+
- href: index.qmd
9+
text: Home
10+
- about.qmd
11+
12+
format:
13+
html:
14+
theme:
15+
- cosmo
16+
- brand
17+
css: styles.css
18+
toc: true
19+
20+
21+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: "About"
3+
---
4+
5+
About this site
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
title: "mysite"
3+
_quarto:
4+
tests:
5+
html:
6+
ensureFileRegexMatches:
7+
- ['href=""']
8+
---
9+
10+
::: {.panel-tabset}
11+
12+
## First tab
13+
14+
1. Press Tab. "First tab" should be focused.
15+
2. Press Right Arrow. "Second tab" should now be active and focused.
16+
17+
## Second tab
18+
19+
Other text might go here
20+
21+
:::
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* css styles */

0 commit comments

Comments
 (0)