Skip to content

Commit

Permalink
fix(Tabs): prevent tablist role from stealing focus (#7905)
Browse files Browse the repository at this point in the history
* fix(tabs): remove default tablist outlines

* fix(Tabs): prevent tablist role from stealing focus

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
emyarod and kodiakhq[bot] authored Mar 1, 2021
1 parent 0cb4b30 commit 69d79ef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/components/src/components/tabs/_tabs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@
padding: 0;
overflow: auto hidden;
list-style: none;
outline: 0;
transition: max-height $duration--fast-01 motion(standard, productive);

// hide scrollbars
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/components/Tabs/Tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ export default class Tabs extends React.Component {
) {
const currentScrollLeft = this.state.tablistScrollLeft;
tab?.tabAnchor?.scrollIntoView({ block: 'nearest', inline: 'nearest' });
tab?.tabAnchor?.focus();
const newScrollLeft = this.tablist.current.scrollLeft;
if (newScrollLeft > currentScrollLeft) {
this.tablist.current.scrollLeft += this.OVERFLOW_BUTTON_OFFSET;
Expand Down

0 comments on commit 69d79ef

Please sign in to comment.