Skip to content

fix: ResetColumnWidths in FluentDataGrid #2517

@ksbecker

Description

@ksbecker

🐛 Bug Report

When you type Shift+R on a page with multiple FluentDataGrids, all of the data grid columns on the page will resize to a single configuration.

💻 Repro or Code Sample

Go to the documentation website and hit Shift+R on your keyboard. Notice that most of the columns will be irregularly resized.

🤔 Expected Behavior

Each data grid column should reset to its own initial size.

😯 Current Behavior

Each data grid column is set irregularly.

💁 Possible Solution

Each data grid needs to have its own initialCoumnsWidth value stored using something like a dictionary. I'm not sure if there's a unique id for each data grid automatically assigned, but that would be a good key for the dictionary.

🔦 Context

On line 1 of the FluendDataGrid.razor.js file there is a global/module level variable called initialColumnsWidths. This variable is shared across all data grids, it seems. It would be ideal to have a dictionary to store the initial column widths for each data grid.

🌍 Your Environment

  • OS & Device: Windows
  • Browser Microsoft Edge, Google Chrome
  • .NET and Fluent UI Blazor library Version 4.9.3

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions