mirror of
https://github.com/jeffvli/feishin.git
synced 2026-06-19 18:04:22 +02:00
handle table row index values on paginated lists
This commit is contained in:
@@ -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 ? (
|
||||
|
||||
Reference in New Issue
Block a user