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 />
|
||||
<RecordTableScrollToFocusedRowEffect />
|
||||
{recordTableIsEmpty && !hasRecordGroups ? (
|
||||
<RecordTableEmpty
|
||||
tableBodyRef={tableBodyRef}
|
||||
hasRecordGroups={hasRecordGroups}
|
||||
/>
|
||||
<RecordTableEmpty tableBodyRef={tableBodyRef} />
|
||||
) : (
|
||||
<RecordTableContent
|
||||
tableBodyRef={tableBodyRef}
|
||||
|
||||
@ -1,17 +1,22 @@
|
||||
import { StyledTable } from '@/object-record/record-table/components/RecordTableStyles';
|
||||
import { RecordTableEmptyState } from '@/object-record/record-table/empty-state/components/RecordTableEmptyState';
|
||||
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 {
|
||||
tableBodyRef: React.RefObject<HTMLTableElement>;
|
||||
hasRecordGroups: boolean;
|
||||
}
|
||||
|
||||
export const RecordTableEmpty = ({ tableBodyRef }: RecordTableEmptyProps) => (
|
||||
<>
|
||||
<StyledEmptyStateContainer>
|
||||
<StyledTable ref={tableBodyRef}>
|
||||
<RecordTableHeader />
|
||||
</StyledTable>
|
||||
<RecordTableEmptyState />
|
||||
</>
|
||||
</StyledEmptyStateContainer>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user