fix: prevent empty state from scrolling in table view (#12197)
https://github.com/user-attachments/assets/334ffd15-a639-4947-8142-c19bc231c9bd Closes #12132
This commit is contained in:
@ -68,10 +68,7 @@ export const RecordTable = () => {
|
|||||||
<RecordTableScrollToFocusedCellEffect />
|
<RecordTableScrollToFocusedCellEffect />
|
||||||
<RecordTableScrollToFocusedRowEffect />
|
<RecordTableScrollToFocusedRowEffect />
|
||||||
{recordTableIsEmpty && !hasRecordGroups ? (
|
{recordTableIsEmpty && !hasRecordGroups ? (
|
||||||
<RecordTableEmpty
|
<RecordTableEmpty tableBodyRef={tableBodyRef} />
|
||||||
tableBodyRef={tableBodyRef}
|
|
||||||
hasRecordGroups={hasRecordGroups}
|
|
||||||
/>
|
|
||||||
) : (
|
) : (
|
||||||
<RecordTableContent
|
<RecordTableContent
|
||||||
tableBodyRef={tableBodyRef}
|
tableBodyRef={tableBodyRef}
|
||||||
|
|||||||
@ -1,17 +1,22 @@
|
|||||||
import { StyledTable } from '@/object-record/record-table/components/RecordTableStyles';
|
import { StyledTable } from '@/object-record/record-table/components/RecordTableStyles';
|
||||||
import { RecordTableEmptyState } from '@/object-record/record-table/empty-state/components/RecordTableEmptyState';
|
import { RecordTableEmptyState } from '@/object-record/record-table/empty-state/components/RecordTableEmptyState';
|
||||||
import { RecordTableHeader } from '@/object-record/record-table/record-table-header/components/RecordTableHeader';
|
import { RecordTableHeader } from '@/object-record/record-table/record-table-header/components/RecordTableHeader';
|
||||||
|
import styled from '@emotion/styled';
|
||||||
|
|
||||||
|
const StyledEmptyStateContainer = styled.div`
|
||||||
|
height: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
`;
|
||||||
|
|
||||||
export interface RecordTableEmptyProps {
|
export interface RecordTableEmptyProps {
|
||||||
tableBodyRef: React.RefObject<HTMLTableElement>;
|
tableBodyRef: React.RefObject<HTMLTableElement>;
|
||||||
hasRecordGroups: boolean;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const RecordTableEmpty = ({ tableBodyRef }: RecordTableEmptyProps) => (
|
export const RecordTableEmpty = ({ tableBodyRef }: RecordTableEmptyProps) => (
|
||||||
<>
|
<StyledEmptyStateContainer>
|
||||||
<StyledTable ref={tableBodyRef}>
|
<StyledTable ref={tableBodyRef}>
|
||||||
<RecordTableHeader />
|
<RecordTableHeader />
|
||||||
</StyledTable>
|
</StyledTable>
|
||||||
<RecordTableEmptyState />
|
<RecordTableEmptyState />
|
||||||
</>
|
</StyledEmptyStateContainer>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user