mirror of
https://github.com/FunnyWolf/agentic-soc-platform.git
synced 2026-08-22 13:12:56 +02:00
fix(frontend): fill available table height
Ensure short datasets use the DataTable body's calculated viewport height instead of collapsing to their content height. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import type {Key} from 'react'
|
||||
import type {CSSProperties, Key} from 'react'
|
||||
import {useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState} from 'react'
|
||||
import {Button, Checkbox, Divider, Input, Pagination, Popconfirm, Popover, Select, Space, Table, Tooltip} from 'antd'
|
||||
import {message} from '../utils/appMessage'
|
||||
@@ -775,6 +775,9 @@ export default function DataTable<RecordType extends Record<string, unknown> = R
|
||||
const activeFilterCount = filterState.advanced.filter(isActiveAdvancedFilter).length
|
||||
const filterSummary = savedFilterName || (activeFilterCount > 0 ? `${activeFilterCount} filter(s)` : '')
|
||||
const renderedActions = typeof actions === 'function' ? actions({ params: tableParams }) : actions
|
||||
const tableStyle: CSSProperties & {'--asp-table-body-height': string} = {
|
||||
'--asp-table-body-height': `${tableBodyHeight}px`,
|
||||
}
|
||||
const searchControl = (
|
||||
<Input.Search
|
||||
placeholder={searchPlaceholder}
|
||||
@@ -902,6 +905,7 @@ export default function DataTable<RecordType extends Record<string, unknown> = R
|
||||
<Table<RecordType>
|
||||
key={tableResetKey}
|
||||
className="asp-data-table"
|
||||
style={tableStyle}
|
||||
columns={antColumns}
|
||||
dataSource={data}
|
||||
rowKey={rowKey}
|
||||
|
||||
@@ -113,6 +113,10 @@ input:-webkit-autofill:active,
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.asp-data-table .ant-table-body {
|
||||
min-height: var(--asp-table-body-height);
|
||||
}
|
||||
|
||||
.asp-table-floating-help {
|
||||
position: absolute;
|
||||
right: 12px;
|
||||
|
||||
Reference in New Issue
Block a user