本文へスキップ
Skillpedia
WebサイトとUI(フロントエンド)75k · #2851

focus-order

できること

このスキルは、ページ上でキーボードのフォーカスが移動する順番を確認します。キーボードの利用者が、コンテンツの中をなめらかに移動できるようにしたい開発者向けです。

使う場面

  • ✓Tab キーを押すと、ページ内を混乱した形で移動するとき。
  • ✓正の tabindex の値があり、取り除きたいとき。
  • ✓ダイアログが閉じた後に、フォーカスが正しい場所に戻らないとき。

スキルのリンク

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/focus-order/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/focus-order/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“ページのタブ順が理にかなっているか、確認してもらえますか。”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは、HTML の順番と使われている tabindex の値を確認します。マークアップを視覚的なレイアウトに合わせて並べ、正の tabindex の数値を避けることを提案します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Ensure logical focus order

When focus jumps unexpectedly, keyboard users get disoriented and can't find content—mismatched visual and focus order makes navigation impossible.

Quick Reference

  • Tab order should match visual reading order (left-to-right, top-to-bottom)
  • DOM order determines tab order—arrange HTML to match visual layout
  • Never use positive tabindex values (1, 2, 3)—they break natural flow
  • Use CSS for visual positioning, not DOM reordering

Check

Tab through the page and verify focus moves in a logical sequence matching visual layout. Check that modals trap focus appropriately, and focus returns to triggering elements when dialogs close.

Fix

Order DOM elements to match visual layout. Avoid positive tabindex values which override natural order. Use tabindex='0' for custom interactive elements and tabindex='-1' for programmatic focus management.

Explain

Explain how keyboard users rely on predictable tab order to navigate efficiently, and why mismatched visual and focus order creates confusion and reduces usability for assistive technology users.

Code Review

Review the rendered markup and interactive states that affect Ensure logical focus order. Flag exact elements, roles, labels, focus behavior, or keyboard interactions that violate the rule, and note how to verify the fix with browser accessibility tooling or assistive tech.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/accessibility/focus-order

よくある質問

なぜタブ順が重要なのですか?

キーボードの利用者は、ページを効率よく移動するために、予測できる順番に頼っているからです。

要素の移動には CSS を使うべきですか?

HTML の順番を並べ替えるのではなく、見た目の配置には CSS を使うことを推奨しています。

tabindex の 0 と -1 は何を意味しますか?

0 はカスタム要素をタブ順に含め、-1 はコードからのフォーカスだけを許可するという意味だとこのスキルは説明しています。

詳細

作者による元の説明

Use when reviewing rendered HTML, interactive components, or design-system patterns related to Ensure logical focus order. Check native semantics first, then inspect keyboard behavior, focus flow, accessible names, and screen-reader output where relevant.

repo: thedaviddias/Front-End-Checklist

人気

GitHubのスター
75k
ランキング
#2851
ライセンス
MIT
更新日
2026/10/31

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル