quarto-dev / quarto-dev/quarto-cli

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

オープン
#730 コメント 4 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

accessibility bug tabsets
主要言語
JavaScript
スター
6k
フォーク
458
平均マージ
1日 9時間
マージ済み PR(30日)
41

説明

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 😂

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript
領域
accessibility, frontend
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。