Skip to content

[Feat] Virtualized DataGrid with autoFitColumns: false #176

Closed
@rocketBANG

Description

@rocketBANG

For the virtualized dataGrid (@fluentui-contrib/react-data-grid-react-window), the scrollbar is on the body

This is fine if the columns all fit without a horizontal overflow, however if there is some horizontal scrollbar there's no way to scroll both the body and the headers at the same time. So when autoFitColumns is set to false, this causes issues

overflow-x: auto can be applied to the parent container, but that means the vertical scrollbar won't be visible unless the user scrolls all the way to the right
image
https://codesandbox.io/p/sandbox/datagrid-body-overflow-forked-ygzvhs?workspaceId=2e8388ff-7617-4f14-8fb7-fe6621520941

overflow-x: auto can be applied to the DataGridBody, but that means the DataGridHeaders won't scroll with the body and the column data and headers will be misaligned
image
https://codesandbox.io/p/sandbox/datagrid-bodysize-bug-forked-6xqrry?file=%2Fsrc%2Fexample.tsx

(for the sandboxes, try resizing some columns to be larger and then observe the scrollbar positions/behaviours)

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