tusen-ai/naive-ui

Feature request: better ARIA support and less click listeners

オープン

#41 opened on 2021/06/09

 (12 件のコメント) (5 件のリアクション) (0 人の担当者)TypeScript (1,531 件のフォーク)batch import
a11yfeature requesthelp wantedpr welcome

Repository metrics

Stars
 (14,240 個のスター)
PR merge metrics
 (PR metrics pending)

説明

What problem does the feature solve?

I find there're two issues on the doc website:

  • some clickable targets have no [role="button"], like dropdown menuitems, radio buttons and breadcrumbs
  • some non-clickable components has click listeners, like tags
  • some disabled components still has click listeners but no [aria-disabled] is added, like cascader menuitems and checkboxes
  • usually a <input> is wrapped by <div>s, and the div.n-input has a click listener but without [aria-hidden=true]

What does the proposed API look like?

I have an extension "Vimium C" to help users use keyboard to click page elements, and when it find links, it will pick those with [role=button], [role=link] and filter out those [aria-hidden], [aria-disabled], [aria-hidden=true], [aria-disabled=true]. It also hooks the global addEventListener function to learn what "plain" elements are clickable.

When I tested Vimium C's LinkHints.activate (triggered by f) on pages like https://www.naiveui.com/zh-CN/os-theme/components/input , I found many clickable were not recognized, while many others were mistakenly hinted.

So I want this framework to add more clues to let such keyboard helper extensions work better.

コントリビューターガイド