src/services/focus.mjs
BeforeProposed
+1−1
2222 const order = focusOrder(items);
2323 if (!order.length) return {order, focus: null};
2424 const index = order.indexOf(current);
25 const target = index < 0 ? 0 : index + (direction === 'next' ? 1 : -1);
25 const target = index < 0 ? (direction === 'next' ? 0 : order.length - 1) : (index + (direction === 'next' ? 1 : -1) + order.length) % order.length;
2626 return {order, focus: order[target]};
2727}