Skip to content

Commit

Permalink
fix(tabs): updated orientation to support screen readers expectations
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarun Tomar authored and Westbrook Johnson committed Jul 26, 2023
1 parent 2f27017 commit 7c7c595
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions packages/tabs/src/Tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,7 @@ export class Tabs extends SizedMixin(Focusable) {
});
return firstFocusableElement ? focusInIndex : -1;
},
direction: () =>
this.direction === 'horizontal' ? 'horizontal' : 'vertical',
direction: () => 'both',
elementEnterAction: (el) => {
if (!this.auto) return;

Expand Down
4 changes: 2 additions & 2 deletions tools/reactive-controllers/src/FocusGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,9 @@ export class FocusGroupController<T extends HTMLElement>
}
switch (this.direction) {
case 'horizontal':
return code.startsWith('Arrow');
return code === 'ArrowLeft' || code === 'ArrowRight';
case 'vertical':
return code.startsWith('Arrow');
return code === 'ArrowUp' || code === 'ArrowDown';
case 'both':
case 'grid':
return code.startsWith('Arrow');
Expand Down

0 comments on commit 7c7c595

Please sign in to comment.