Fix search results being capped to window height
This commit is contained in:
parent
011f260e94
commit
611cbc6dd9
2 changed files with 9 additions and 10 deletions
|
@ -1,3 +1,4 @@
|
|||
import { MutableRefObject, useMemo, useCallback } from 'react';
|
||||
import {
|
||||
ColDef,
|
||||
GridReadyEvent,
|
||||
|
@ -6,7 +7,7 @@ import {
|
|||
} from '@ag-grid-community/core';
|
||||
import type { AgGridReact as AgGridReactType } from '@ag-grid-community/react/lib/agGridReact';
|
||||
import { Stack } from '@mantine/core';
|
||||
import { MutableRefObject, useMemo, useCallback } from 'react';
|
||||
import { generatePath, useNavigate } from 'react-router';
|
||||
import { useParams, useSearchParams } from 'react-router-dom';
|
||||
import { LibraryItem, QueueSong } from '/@/renderer/api/types';
|
||||
import { VirtualGridAutoSizerContainer } from '/@/renderer/components/virtual-grid';
|
||||
|
@ -18,7 +19,6 @@ import {
|
|||
SONG_CONTEXT_MENU_ITEMS,
|
||||
} from '/@/renderer/features/context-menu/context-menu-items';
|
||||
import { usePlayQueueAdd } from '/@/renderer/features/player';
|
||||
import { generatePath, useNavigate } from 'react-router';
|
||||
import { AppRoute } from '../../../router/routes';
|
||||
import {
|
||||
useCurrentServer,
|
||||
|
@ -44,8 +44,6 @@ export const SearchContent = ({ tableRef, getDatasource }: SearchContentProps) =
|
|||
const handlePlayQueueAdd = usePlayQueueAdd();
|
||||
const playButtonBehavior = usePlayButtonBehavior();
|
||||
|
||||
const isPaginationEnabled = true;
|
||||
|
||||
const getTable = useCallback(
|
||||
(itemType: string) => {
|
||||
switch (itemType) {
|
||||
|
@ -139,17 +137,11 @@ export const SearchContent = ({ tableRef, getDatasource }: SearchContentProps) =
|
|||
}}
|
||||
getRowId={(data) => data.data.id}
|
||||
infiniteInitialRowCount={25}
|
||||
pagination={isPaginationEnabled}
|
||||
paginationAutoPageSize={isPaginationEnabled}
|
||||
paginationPageSize={table.pagination.itemsPerPage || 100}
|
||||
rowBuffer={20}
|
||||
rowHeight={table.rowHeight || 40}
|
||||
rowModelType="infinite"
|
||||
rowSelection="multiple"
|
||||
// onBodyScrollEnd={handleScroll}
|
||||
onCellContextMenu={handleContextMenu}
|
||||
// onColumnMoved={handleColumnChange}
|
||||
// onColumnResized={debouncedColumnChange}
|
||||
onGridReady={onGridReady}
|
||||
onGridSizeChanged={handleGridSizeChange}
|
||||
onRowDoubleClicked={handleRowDoubleClick}
|
||||
|
|
|
@ -66,6 +66,8 @@ const SearchRoute = () => {
|
|||
lastRow = startIndex + numOfItems;
|
||||
}
|
||||
|
||||
console.log('lastRow', lastRow);
|
||||
|
||||
params.successCallback(items, lastRow);
|
||||
},
|
||||
};
|
||||
|
@ -111,6 +113,8 @@ const SearchRoute = () => {
|
|||
lastRow = startIndex + numOfItems;
|
||||
}
|
||||
|
||||
console.log('lastRow', lastRow);
|
||||
|
||||
params.successCallback(items, lastRow);
|
||||
},
|
||||
};
|
||||
|
@ -155,6 +159,9 @@ const SearchRoute = () => {
|
|||
if (numOfItems < limit) {
|
||||
lastRow = startIndex + numOfItems;
|
||||
}
|
||||
console.log('items', items);
|
||||
console.log('numOfItems :>> ', numOfItems);
|
||||
console.log('lastRow', lastRow);
|
||||
|
||||
params.successCallback(items, lastRow);
|
||||
},
|
||||
|
|
Reference in a new issue