Save the role as an input when accepting

This commit is contained in:
2026-02-28 08:17:55 +00:00
parent 38a0ac436b
commit 66e9918e04
6 changed files with 85 additions and 53 deletions

View File

@@ -147,7 +147,7 @@ function findNextValidIndex<T>(
if (currentVisiblePos === -1) {
// Current index is hidden, find nearest visible
return visibleIndices[0];
return visibleIndices[0] ?? 0;
}
// Calculate next position
@@ -160,7 +160,7 @@ function findNextValidIndex<T>(
nextVisiblePos = Math.max(0, Math.min(visibleIndices.length - 1, nextVisiblePos));
}
return visibleIndices[nextVisiblePos];
return visibleIndices[nextVisiblePos] ?? 0;
}
/**