Sometimes, there are sets of interactive elements that we want users to be able to navigate through with arrow keys rather than with tabs, and we want the final focus change to wrap. This module makes it easier to set up this focus and wrapping behavior.
Zip a list of items with its corresponding keyboard events.
Helper for creating a list of elements with looping arrow-key navigation.
Your
viewfunction will be called for each item with the corresponding keyboard event handlers, as well as the item itself.e.g.
Does your list support adding and removing items? If so, check out
FocusLoop.Lazywhich will prevent recalculation of event handlers for every item when the list changes.