Skip to content

Commit cd62e62

Browse files
emyarodjoshblack
authored andcommitted
fix(Tabs): allow keyboard event defaults (#5124)
1 parent 1b3fe3a commit cd62e62

File tree

1 file changed

+2
-2
lines changed
  • packages/react/src/components/Tabs

1 file changed

+2
-2
lines changed

packages/react/src/components/Tabs/Tabs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,10 @@ export default class Tabs extends React.Component {
180180
}
181181

182182
if (window.matchMedia('(min-width: 42rem)').matches) {
183-
evt.preventDefault();
184183
const nextIndex = this.getNextIndex(index, this.getDirection(evt));
185184
const tab = this.getTabAt(nextIndex);
186-
if (tab) {
185+
if (tab && matches(evt, [keys.ArrowLeft, keys.ArrowRight])) {
186+
evt.preventDefault();
187187
this.selectTabAt(nextIndex, onSelectionChange);
188188
if (tab.tabAnchor) {
189189
tab.tabAnchor.focus();

0 commit comments

Comments
 (0)