Disabling buttons is confusing
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
この issue はまだ評価されていません。
説明
As noted in #7879, there are three separate ways to disable a button:
disabledaria-disabledinactive
Our accessibility guidance generally discourages disabled because it makes buttons inaccessible by keyboard navigation, which may make them undiscoverable to screen readers. So I avoid this.
aria-disabled generally seems to work well, making buttons visually disabled while leaving them focusable and ensuring that screen reader users understand they are disabled. So I'm tempted to just reach for aria-disabled all the time.
However, there is also the inactive prop, and it's not clear why this exists or when we should prefer it over aria-disabled. Visually they are distinct, which makes inactive buttons visually inconsistent with other buttons. And inactive completely overrides variant. To be honest, inactive feels redundant, with limited functionality - I'm tempted to avoid it altogether.
There's a docs section on what an inactive button is:
An inactive Button is an accessible alternative to a disabled Button. They're intended to be used for buttons that are non-functional, but cannot be removed from the page.
Unlike a disabled Button, an inactive Button can respond to user input. For example, if a Button shows a tooltip when hovered or focused, or a Dialog when clicked.
But this just raises more questions than it answers - why would I use inactive if I can get exactly the same functionality from aria-disabled but with much better styling and variant support?
Possible solutions
Ideally we need to create explicit clarity around the correct way to disable buttons, without making consumers dig through several different docs to try and determine this for themselves.
I would propose the following:
- Deprecate and remove the
inactiveprop in favor ofaria-disabled - Lint against the
disabledprop in favor ofaria-disabled - Document that
aria-disabledis the preferred approach
Alternatively, we could lean on inactive instead:
- Improve
inactiveso that it works likearia-disabled, supporting variant styling - Lint against
disabledandaria-disabledin favor ofinactive - Document that
inactiveis the preferred approach
- 主要言語
- TypeScript
- スター
- 3.9k
- フォーク
- 697
- 平均マージ
- 3日 21時間
- マージ済み PR(30日)
- 51
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
primer/react のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
primer/react#8561 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
PageHeader.Title does not seem to accept id prop対応中かも @TylerJDev が 4 日前に担当しました。 オープンcomponent: PageHeader react staff
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
primer/react#8474 · コメント 1 件 · リアクション 1 件 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
The padding prop seems to have no effect with PageLayout.Sidebar対応中かも @minwookshin が 16 日前に担当しました。 オープンcomponent: PageLayout react staff
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
primer/react#8470 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信
-
bug component: Spinner react
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
primer/react#8423 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
waiting for author response
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
primer/react#8172 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
似ている issue
-
Endpoint links in the tag operations list are below the 24px target size対応中かも @AdzerKI が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
ai-driven-qa bug Minor
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
linagora/twake-tasks#435 ·
メンテナーはふだん 1 日以内に返信
-
bug domain: database priority: p1 Stellar Wave
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
StellarState/SS-backend#632 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
A2A audit timestamps end in +00:00Z (invalid ISO 8601)対応中かも @O1sumitkumar が今日担当しました。 オープンbug good first issue help wanted python
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
`cf complete zsh >> .zshrc` fails on vanilla zsh再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
cloudflare/cf#340 ·
メンテナーはふだん 1 日以内に返信