Skip to content

Commit

Permalink
fix(Tabs): allow keyboard event defaults (#5124)
Browse files Browse the repository at this point in the history
  • Loading branch information
emyarod authored and joshblack committed Jan 23, 2020
1 parent 1b3fe3a commit cd62e62
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/react/src/components/Tabs/Tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,10 @@ export default class Tabs extends React.Component {
}

if (window.matchMedia('(min-width: 42rem)').matches) {
evt.preventDefault();
const nextIndex = this.getNextIndex(index, this.getDirection(evt));
const tab = this.getTabAt(nextIndex);
if (tab) {
if (tab && matches(evt, [keys.ArrowLeft, keys.ArrowRight])) {
evt.preventDefault();
this.selectTabAt(nextIndex, onSelectionChange);
if (tab.tabAnchor) {
tab.tabAnchor.focus();
Expand Down

0 comments on commit cd62e62

Please sign in to comment.