Closed kunukn closed 3 years ago
nice, great feature request! what do you think of setting direction instead of passing arrays with strings?
rovingIndex({
element: document.querySelector('#vertical-accordions'),
target: '.toggle',
direction: 'vertical',
})
internally, 'vertical'
would use the up/down arrows to move through the targets. horizontal would be default.
what if the library mapped up/down arrow keys to left/right, so direction didnt matter? down and right are the same, and up and left are the same? "just works."
Sounds better than my suggestion :)
I like this one
what if the library mapped up/down arrow keys to left/right, so direction didnt matter? down and right are the same, and up and left are the same? "just works."
I have created this alternative PR
closing as the feature merged in the other PR!
I have a use case where I want to use the up and down keys for the previous and next focus.
API usage example