Disabling buttons is confusing
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
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
- Lenguaje dominante
- TypeScript
- Estrellas
- 3.9k
- Forks
- 697
- Merge medio
- 3 d 12 h
- PR fusionados (30 d)
- 51
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de primer/react
-
PageHeader.Title does not seem to accept id propPosiblemente ocupada @TylerJDev la tomó hace 3 días. Abiertocomponent: PageHeader react staff
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
primer/react#8474 · 1 comentario · 1 reacción · 1 asignado ·
Los mantenedores suelen responder en 2 días
-
The padding prop seems to have no effect with PageLayout.SidebarPosiblemente ocupada @minwookshin la tomó hace 15 días. Abiertocomponent: PageLayout react staff
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
primer/react#8470 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 2 días
-
bug component: Spinner react
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
primer/react#8423 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Low contrast in SelectAbiertowaiting for author response
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
primer/react#8172 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Checkbox: replace useLayoutEffect with ref callback for indeterminate propQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abiertocomponent: Checkbox react
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días
Todos los issues de primer/react
Issues similares
-
documentation good first issue
Dificultad 2/5 Medio día Aptitud para principiantes 72/100
sujithputta02/Esapay#13 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
ehmpathy/rhachet-roles-bhuild#468 ·
Los mantenedores suelen responder en 1 día
-
Share dialog: the address book's contact count reads "1 contacts" (no singular form in any language)Posiblemente ocupada @chibenwa la tomó hoy. Abiertoai-driven-qa bug claude Cosmetic
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
linagora/twake-contacts-frontend#271 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
factory-active task-identify-harness-labels-done task-identify-issue-type-done
Dificultad 1/5 Menos de una hora Aptitud para principiantes 70/100
vercel/ai#23435 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Koenkk/zigbee2mqtt#33402 ·
Los mantenedores suelen responder en 1 día