Skip to content

Commit

Permalink
fix(Tabs): prevent keyboard focus of scroll buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
emyarod committed Oct 16, 2020
1 parent 3e8ed73 commit 9921286
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/react/src/components/Tabs/Tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,14 +424,16 @@ export default class Tabs extends React.Component {
<div className={`${prefix}--tabs--scrollable`}>
<div {...other} className={classes.tabs} onScroll={this.handleScroll}>
<button
type="button"
aria-hidden="true"
className={classes.leftOverflowButtonClasses}
onClick={(_) => this.handleOverflowNavClick(_, { direction: -1 })}
onMouseDown={(event) =>
this.handleOverflowNavMouseDown(event, { direction: -1 })
}
onMouseUp={this.handleOverflowNavMouseUp}
ref={this.leftOverflowNavButton}>
ref={this.leftOverflowNavButton}
tabIndex="-1"
type="button">
<ChevronLeft16 />
</button>
{!leftOverflowNavButtonHidden && (
Expand All @@ -444,14 +446,16 @@ export default class Tabs extends React.Component {
<div className={`${prefix}--tabs__overflow-indicator--right`} />
)}
<button
type="button"
aria-hidden="true"
className={classes.rightOverflowButtonClasses}
onClick={(_) => this.handleOverflowNavClick(_, { direction: 1 })}
onMouseDown={(event) =>
this.handleOverflowNavMouseDown(event, { direction: 1 })
}
onMouseUp={this.handleOverflowNavMouseUp}
ref={this.rightOverflowNavButton}>
ref={this.rightOverflowNavButton}
tabIndex="-1"
type="button">
<ChevronRight16 />
</button>
</div>
Expand Down

0 comments on commit 9921286

Please sign in to comment.