quarto-dev / quarto-dev/quarto-cli

Keyboard tabbing order of tabset tabs and focusable controls within tabset content

Aperta
#730 4 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

accessibility bug tabsets
Lingua principale
JavaScript
Stelle
6k
Fork
458
Merge medio
1g 9h
PR unite (30g)
41

Descrizione

I'm seeing some inconsistency with the keyboard tabbing order when I use tabsets.

In this example, in which I've styled the tabs to appear at the bottom of the page (deployed version available here), the tabs have tabindex="0" and so are tabbable - but tabbing to put focus on them activates them, so it's impossible to then tab onto focusable elements within the tabset content (eg. checkboxes or dropdowns) unless you click on one of them first.

In the following example, the tabs aren't receiving any tabindex attribute at all and so aren't tabbable:

---
title: "Test tabs"
author: "jimjamslam"
---

Let's try some tabs!

::: {.panel-tabset}

## Tab A

This is just some explanatory text. No biggie...

## Tab B

Let's add some focusable controls here!

```{ojs}
viewof catSelect = Inputs.select(
  ["Apple", "Banana", "Orange", "Kiwi"],
  { label: "Choose a fruit"});

viewof numSelect = Inputs.range([1, 20], { label: "And a number" });
```

## Tab C

Some more text here! Could be lots of stuff.

```{ojs}
viewof check = Inputs.checkbox(
  ["Don't forget to check this!"],
  { label: "Options" })
```
## Tab D

Nah, this is all boring.

:::

Ideally, I expect that tabset tabs would be tabbable, but that tabbing onto a different tab would focus it without activating it so that I could continue on to any controls visible (unless I explicitly activated it as I might a hyperlink).

I'm not quite sure why the tabs in my first example have tabindex and the ones in my second don't, unless there's been a change in behaviour that I missed (although I believe I rendered them both with them same versions of everything). (Maybe the styling I used on the tabs in the first, adding display: flex and flex-direction: column-reverse to .panel-tabset to put the tabs below the content, did something weird?)

I think I've said "tab" enough for the rest of the year now 😂

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Start by reproducing the two tabset examples linked in the issue and inspect their generated tab markup, tabindex values, and focus behavior. Compare normal tabsets with the version styled using display:flex and flex-direction:column-reverse; done means keyboard navigation reaches the tabs and controls in a consistent, accessible order without unexpectedly activating a tab.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript
Ambito
accessibility, frontend
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.