Skip to content

DataTable/VirtualScroller: When using scrollHeight='flex", grid has no height #8185

Description

@mpearce9

Describe the bug

When I attempt to use scrollHeight="flex" on the DataTable when using the VirtualScroller, I seem to get no height on my Table, the header is visible but no columns are seen, this includes the column header.

In my actual codebase, I noticed that sometimes, if the width is less than 1400px, it'll actually give height to the Datatable, but I cannot make that reproducible in the Stackblitz project

Reproducer

https://stackblitz.com/edit/xf281zjf?file=src%2FApp.jsx

System Information

npmPackages:
    primereact: 10.9.6 => 10.9.6 
    react: 18.3.1 => 18.3.1

Steps to reproduce the behavior

  1. Ensure scrollHeight is set to 'flex' or '100%' etc...
  2. Widen the demo to be majority of the screen
  3. Run code, notice there is no height on the grid
  4. Sometimes for a brief moment you can see the columns appear and then disappear

Expected behavior

I feel like with this setup, I should have height on my DataTable, but it always seems to have a height of 0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution: StaleIssue or pull request is inactivity and unfortunately it will be *closed* if there is no responseStatus: Pending TestIssue or pull request is being tested by Core Team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions