Skip to content

DataPage clips its paginator in a bounded-height container when actions are present #126

Description

@woksin

Problem

DataPage does not allocate the bounded page height between its action bar and query table. With @cratis/components 2.7.0, a DataPage inside a 560px-high container, with DataPage.MenuItems and a paged snapshot query returning 24 rows, clips the lower table rows and the paginator. The rows can scroll inside the table wrapper, but the paginator remains below the clipped page boundary and is unreachable.

Source evidence

At tag v2.7.0:

  • Source/DataPage/DataPage.tsx renders MenuItems and Columns as siblings in an Allotment.Pane whose only layout class is flex-grow.
  • Source/DataTables/DataTableForQuery.tsx gives its outer table container height: 100%.
  • Source/Common/Page.tsx clips its panel with overflow-hidden.

The table therefore claims the full pane height before the action bar is accounted for. Their combined height exceeds the pane and Page clips the end. The current PrimeReact 11 migration branch in PR #107 retains the same sibling layout, so the defect is not specific to the old paginator implementation.

Reproduction

<div style={{ height: 560 }}>
    <DataPage title="Users" query={PagedUsers} emptyMessage="No users">
        <DataPage.MenuItems>
            <MenuItem label="Invite" command={invite} />
        </DataPage.MenuItems>
        <DataPage.Columns>
            <Column field="name" header="Name" />
        </DataPage.Columns>
    </DataPage>
</div>

Return 24 records with a page size of 20. On page one, the paginator is outside the reachable bounded surface. On page two, where only four rows render, it becomes visible again.

Expected

The action bar consumes intrinsic height, the table region receives the remaining height with min-height: 0, rows scroll within that region, and the paginator remains visible/reachable at every page size.

Acceptance

  • The primary Allotment.Pane establishes a min-height: 0 flex-column layout.
  • The action area does not shrink.
  • The columns/table region receives flex: 1; min-height: 0 and owns row scrolling.
  • A bounded-height story or browser spec with more than one page verifies the paginator is visible and clickable while the row region scrolls.
  • The same layout works with and without MenuItems and with the optional details pane.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions