We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 263f867 commit a485e7eCopy full SHA for a485e7e
1 file changed
src/index.ts
@@ -1,14 +1,13 @@
1
type IncrementKey = 'ArrowRight' | 'ArrowDown'
2
type DecrementKey = 'ArrowUp' | 'ArrowLeft'
3
-type NavigationDirection = [IncrementKey, DecrementKey]
4
5
function getTabs(el: TabContainerElement): HTMLElement[] {
6
return Array.from(el.querySelectorAll<HTMLElement>('[role="tablist"] [role="tab"]')).filter(
7
tab => tab instanceof HTMLElement && tab.closest(el.tagName) === el
8
)
9
}
10
11
-function getNavigationKeys(vertical: boolean): NavigationDirection {
+function getNavigationKeys(vertical: boolean): [IncrementKey, DecrementKey] {
12
if (vertical) {
13
return ['ArrowDown', 'ArrowUp']
14
} else {
0 commit comments