Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[material-ui][Switch] Not focusing as the next element in tab index #40864

Open
berenicestr opened this issue Jan 30, 2024 · 6 comments
Open
Assignees
Labels
accessibility a11y bug 🐛 Something doesn't work component: switch This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material

Comments

@berenicestr
Copy link

berenicestr commented Jan 30, 2024

The switch component doesn’t focus as the next element in tab index.
I have tried with the tabIndex and autoFocus props and doesn’t solve it. I use the lastest version of dependencies.

Code: https://stackblitz.com/edit/react-ujnl8h?file=Demo.tsx

Originally posted by @berenicestr in #37753 (comment)

Search keywords:

@github-actions github-actions bot added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jan 30, 2024
@danilo-leal danilo-leal changed the title The switch component doesn’t focus as the next element in tab index. [material-ui][Switch] Not focusing as the next element in tab index Jan 31, 2024
@danilo-leal danilo-leal added accessibility a11y component: switch This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material labels Jan 31, 2024
@DiegoAndai
Copy link
Member

Hey @berenicestr, thanks for the report

I cannot access the code sandbox; apparently, it is not public. May I ask you to update it? Maybe you find it easier to use Stackblitz, as codesandbox recently restricted their usage limits

@DiegoAndai DiegoAndai added status: waiting for author Issue with insufficient information and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Feb 9, 2024
@DiegoAndai DiegoAndai assigned DiegoAndai and unassigned mj12albert Feb 9, 2024
@berenicestr
Copy link
Author

Sorry Diego. I share an example in Stackblitz:
It’s a simple Switch component between two TextFields with TabIndex props.

https://stackblitz.com/edit/react-ujnl8h?file=Demo.tsx
Thanks in advance!

@github-actions github-actions bot added status: waiting for maintainer These issues haven't been looked at yet by a maintainer and removed status: waiting for author Issue with insufficient information labels Feb 9, 2024
@DiegoAndai
Copy link
Member

Thanks for the example! I don't understand what's the bug though, I can tab through the switch component correctly:

Screen.Recording.2024-02-09.at.14.21.06.mov

@DiegoAndai DiegoAndai added status: waiting for author Issue with insufficient information and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Feb 9, 2024
@berenicestr
Copy link
Author

berenicestr commented Feb 9, 2024

Thank you so much for you response! I see your video it’s the functionality OK!

I have tested with bowsers: IE - OK, Firefox, OK, Chrome OK.
Safari (17.3v - latest), and others such DuckDuckGo (Version 1.68.0) - KO, The Switch doesn’t focus when I keypress Tab. It jumps Text1 to Text2.

¿So, is perhaps a bug of this browsers?

Thanks in advance for your support!

@github-actions github-actions bot added status: waiting for maintainer These issues haven't been looked at yet by a maintainer and removed status: waiting for author Issue with insufficient information labels Feb 9, 2024
@DiegoAndai
Copy link
Member

I can confirm a weird behavior in Safari, thanks!

Screen.Recording.2024-02-09.at.16.54.17.mov

I am accepting as a bug. I think this should be solved when refactoring the component to build it on top of Base UI, so I'm adding it to that milestone as well.

@DiegoAndai DiegoAndai added bug 🐛 Something doesn't work and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Feb 9, 2024
@berenicestr
Copy link
Author

Excellent! Thank you so much!

@oliviertassinari oliviertassinari removed this from the Material UI with Base UI milestone Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility a11y bug 🐛 Something doesn't work component: switch This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material
Projects
None yet
Development

No branches or pull requests

5 participants