UNPKG

@kubit-ui-web/react-components

Version:

Kubit React Components is a customizable, accessible library of React web components, designed to enhance your application's user experience

13 lines 482 B
export const keyRightMove = (lengthOptions, position, numTabsInView) => prevFocus => { if (prevFocus + 1 >= lengthOptions || prevFocus + 1 === position + numTabsInView) { return position; } return prevFocus + 1; }; export const keyLeftMove = (position, numTabsInView) => prevFocus => { if (prevFocus - 1 < 0 || prevFocus - 1 < position) { return position - 1 + numTabsInView; } return prevFocus - 1; }; //# sourceMappingURL=getTabMoves.js.map