mui / mui/material-ui

[joy-ui][Select] No focus-outline if focused by label

Open
#39,258 15 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

on hold package: joy-ui scope: select type: bug
Dominant language
JavaScript
Stars
99.1k
Forks
32.5k
Avg merge
2d 17h
Merged PRs (30d)
106

Description

Duplicates
  • I have searched the existing issues
Latest version
  • I have tested the latest version
Steps to reproduce 🕹

Link to live example: https://mui.com/joy-ui/react-select/#accessibility

Steps:

  1. Scroll to accessibility demo
  2. Click on Label
  3. No focus outline
Current behavior 😯

"button" of Select does not have a focus outline if it is focused by a label.

The element is in focus though, So it's just an a11y cosmetic issue.

Expected behavior 🤔

Here's a demo of the desired behavior and also a workaround:

https://codesandbox.io/s/upbeat-haze-qvxzk7?file=/Demo.tsx

Context 🔦

I want consistent a11y and cosmetic appearance of my form fields

Your environment 🌎
npx @mui/envinfo
  System:
    @emotion/react: 11.11.1 => 11.11.1
    @emotion/styled: 11.11.0 => 11.11.0
    @mui/base:  5.0.0-beta.17
    @mui/core-downloads-tracker:  5.14.11
    @mui/icons-material: 5.14.11 => 5.14.11
    @mui/joy: 5.0.0-beta.8 => 5.0.0-beta.8
    @mui/material: ^5.14.11 => 5.14.11
    @mui/private-theming:  5.14.11
    @mui/styled-engine:  5.14.11
    @mui/system:  5.14.11
    @mui/types:  7.2.4
    @mui/utils:  5.14.11
    @types/react: ^18.2.23 => 18.2.23
    react: 18.2.0 => 18.2.0
    react-dom: 18.2.0 => 18.2.0
    typescript: ^5.2.2 => 5.2.2

Browser: all are affected, since it is an issue of setting the correct class on focus

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Joy UI Select accessibility demo linked in the issue and reproduce the problem by clicking its label. Compare the current focus behavior with the linked CodeSandbox workaround; done means the Select button visibly shows its focus outline when focused through the label.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
accessibility, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.