Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
アクセシブルなインクリメンタルサーチを作ってみた
Search
mattsuu
July 16, 2024
Technology
630
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
アクセシブルなインクリメンタルサーチを作ってみた
アクセシビリティLT会 (2024/07/16) での発表資料
https://yumemi.connpass.com/event/323801/
mattsuu
July 16, 2024
More Decks by mattsuu
See All by mattsuu
pnpm に provenance のダウングレード を検出する PR を出してみた
ryo_manba
1
390
CSS Linter の現在地 2025年のベストプラクティスを探る
ryo_manba
12
4.5k
CSS Linter による Baseline サポートの仕組み
ryo_manba
1
420
React Aria で実現する次世代のアクセシビリティ
ryo_manba
5
3.3k
5分で分かる React Aria の 良いところ・これからなところ
ryo_manba
5
7k
Next.js の fetch 拡張とキャッシュ機構の違いを理解する
ryo_manba
6
1.9k
React Spectrum Libraries によるアクセシブルなUIの構築
ryo_manba
0
4.7k
Other Decks in Technology
See All in Technology
AI Agent を本番環境へ―― Microsoft Foundry × Azure Serverless で作る Enterprise-Ready な基盤
shibayan
PRO
1
970
LLMリーダーボードアップデートに向けたAgentic Math_SWEのトレースについて
nejumi
0
180
A Bag-of-Documents Model for Query Specificity
dtunkelang
0
180
書籍セキュアAPIについて
riiimparm
0
390
Escolhendo LLMs na Prática: Lições Reais em Busca Agêntica no Mercado Livre —TDC 2026 Floripa
jpbonson
0
110
もう一度考える SRE チームの作り方・育て方 / Rethinking SRE #1: Building and Growing SRE Teams
rrreeeyyy
1
240
AIがAPIを書く時代に、私たちは何を設計すべきか
nagix
0
180
AWS環境のセキュリティ不安を解消した企業事例 ~よくある課題と対策を一挙公開~
asanoharuki
0
260
データと地図で読む 大井町の「かわるもの、かわらないもの」
yoshiyama_hana
0
840
システム監視入門
grimoh
5
780
現場で使える AWS DevOps Agent 活用ノウハウ - Release Management 機能の検証結果を添えて / AWS DevOps Agent Release Management and Know-How
kinunori
5
820
PLaMo 3.0 Primeの事後学習
pfn
PRO
0
220
Featured
See All Featured
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.8k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
BBQ
matthewcrist
89
10k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
Practical Orchestrator
shlominoach
191
11k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
450
Crafting Experiences
bethany
1
230
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
560
How GitHub (no longer) Works
holman
316
150k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
520
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.8k
Transcript
アクセシブルな インクリメンタルサーチを作ってみた まっつー / @ryo_manba 2024/07/16 アクセシビリティ LT 会
自己紹介 まっつー サイボウズのフロントエンドエンジニア NextUI の team member X: @ryo_manba GitHub:
@ryo-manba 2
個人サイトで記事を探せるようにしました
インクリメンタルサーチとは 文字入力するごとに検索結果が絞り込まれる検索方式のこと
インクリメンタルサーチの課題 • 支援技術を利用するユーザーがリアルタイム更新に気付 けない • 検索結果が見つからなかった場合に気付けない
aria-describedby で機能の説明を紐付ける <input id="search" type="search" aria-describedby="search-description" /> <p id="search-description" className="sr-only">
入力するごとに記事が絞り込まれます </p> aria-describedby を使用して、検索コンポーネントがリア ルタイムに結果を更新することを伝える
aria-describedby で機能の説明を紐付ける 入力コンポーネントにフォーカスが当たった際にどのように 機能するか伝わる
結果が存在しない場合は即座に伝える <div aria-live="assertive" aria-atomic="true"> {noPostsFound && ( <p className="sr-only"> 記事が見つかりませんでした。
</p> )} </div> ARIA-live regions を活用して、入力結果が存在しない場合 に即座にアナウンスさせる
結果が存在しない場合は即座に伝える 即座にアナウンスされるため、ユーザーが不要な入力を避け られる
ユーザー体験を損ねる ARIA live regions の使い方 • 検索結果のコンテナに aria-live=”assertive” を指定する ◦
検索結果が更新されるたびに不要なアナウンスが発生する ◦ 頻発なアナウンスがノイズとなり、ユーザー体験を損ねる <div aria-live="assertive" aria-atomic="true"> {posts.map((post) => ( <BlogCard {...post} /> ))} </div>
ユーザー体験を損ねる ARIA live regions の使い方
まとめ インクリメンタルサーチをアクセシブルにするために以下の 実装を試しました • 機能の説明を入力コンポーネントに関連付ける • 結果が存在しない場合は即座にアナウンスさせる https://www.scottohara.me/blog/2022/02/05/dynamic-results.html https://www.sarasoueidan.com/blog/accessible-notifications-with-aria-live-regions-part-2/