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

fix(Tabs): prevent tablist role from stealing focus #7905

Conversation

emyarod
Copy link
Member

@emyarod emyarod commented Feb 25, 2021

Closes #7892

when the tablist role is applied to an element, it becomes focusable on click. In Safari, clicking on a Carbon tab within the tab container was stealing focus away from the tab and adding browser default outlines to the element with role="tablist". This PR overrides the browser styles and explicitly calls focus() on the selected tab to ensure focus remains on the selected tab (non-Safari browsers did not need this to keep focus on the selected tab)

Testing / Reviewing

Ensure the correct element is focused in Safari after selecting tabs via mouse and ensure no behavioral regressions appear in non-Safari browsers

@netlify
Copy link

netlify bot commented Feb 25, 2021

Deploy preview for carbon-elements ready!

Built with commit 7956384

https://deploy-preview-7905--carbon-elements.netlify.app

Copy link
Collaborator

@tw15egan tw15egan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, no longer seeing (incorrect) focus in Safari 👍 ✅

@netlify
Copy link

netlify bot commented Feb 25, 2021

Deploy preview for carbon-components-react ready!

Built without sensitive environment variables with commit 7956384

https://deploy-preview-7905--carbon-components-react.netlify.app

@kodiakhq kodiakhq bot merged commit 69d79ef into carbon-design-system:master Mar 1, 2021
@emyarod emyarod deleted the 7892-safari-role-tablist-stealing-focus branch March 2, 2021 16:17
@dakahn dakahn mentioned this pull request Mar 4, 2021
@emyarod emyarod mentioned this pull request Mar 8, 2021
60 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tabs highlight on Tab click in safari, but none in chrome/firefox
3 participants