We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 22bbc04 commit b25165dCopy full SHA for b25165d
1 file changed
packages/eui/src/components/tabs/tabs.tsx
@@ -80,10 +80,11 @@ export const EuiTabs = forwardRef<EuiTabRef, EuiTabsProps>(
80
);
81
82
if (event.key === keys.ARROW_LEFT) {
83
- const previousIndex = (currentIndex - 1 + tabs.length) % tabs.length;
+ const previousIndex =
84
+ (currentIndex === 0 ? tabs.length : currentIndex) - 1;
85
tabs[previousIndex].focus();
86
} else if (event.key === keys.ARROW_RIGHT) {
- const nextIndex = (currentIndex + 1) % tabs.length;
87
+ const nextIndex = currentIndex === tabs.length ? 0 : currentIndex + 1;
88
tabs[nextIndex].focus();
89
}
90
};
0 commit comments