handle table row index values on paginated lists

This commit is contained in:
jeffvli
2025-11-19 15:55:36 -08:00
parent 0dff13c43f
commit c691c349dd
8 changed files with 42 additions and 15 deletions
@@ -37,11 +37,16 @@ const DefaultRowIndexColumn = (props: ItemTableListInnerColumn) => {
internalState,
itemType,
rowIndex,
startRowIndex,
} = props;
const adjustedRowIndex =
let adjustedRowIndex =
adjustedRowIndexMap?.get(rowIndex) ?? (enableHeader ? rowIndex : rowIndex + 1);
if (startRowIndex !== undefined && adjustedRowIndex > 0) {
adjustedRowIndex = startRowIndex + adjustedRowIndex;
}
if (enableExpansion) {
return (
<TableColumnContainer {...props}>
@@ -75,10 +80,14 @@ const QueueSongRowIndexColumn = (props: ItemTableListInnerColumn) => {
const song = props.data[props.rowIndex] as QueueSong;
const isActive = props.activeRowId === song?._uniqueId;
const adjustedRowIndex =
let adjustedRowIndex =
props.adjustedRowIndexMap?.get(props.rowIndex) ??
(props.enableHeader ? props.rowIndex : props.rowIndex + 1);
if (props.startRowIndex !== undefined && adjustedRowIndex > 0) {
adjustedRowIndex = props.startRowIndex + adjustedRowIndex;
}
return (
<TableColumnTextContainer {...props}>
{isActive ? (