fluentui-blazor icon indicating copy to clipboard operation
fluentui-blazor copied to clipboard

fix: ResizeableColumns not working in FluentDataGrid

Open czielin opened this issue 1 year ago • 2 comments

🐛 Bug Report

After updating from 4.9.0 to 4.11.7 the ResizeableColumns parameter no longer works on our FluentDataGrids.

💻 Repro or Code Sample

🤔 Expected Behavior

The column separators should render correctly, there should be no script error and the columns should be resizeable.

Image

😯 Current Behavior

Using the ResizeableColumns in even simple tables like above does not work. It results in a javascript error, the column separators don't render correctly, nor are the columns resizeable:

Image

[FluentDataGrid] Cannot read properties of null (reading 'addEventListener') blazor.webassembly.js:1 TypeError: Cannot read properties of null (reading 'addEventListener') blazor.webassembly.js:1 at https://mysite/app/_content/Microsoft.FluentUI.AspNetCore.Components/Components/DataGrid/FluentDataGrid.razor.js:239:47 blazor.webassembly.js:1 at NodeList.forEach () blazor.webassembly.js:1 at enableColumnResizing (https://mysite/app/_content/Microsoft.FluentUI.AspNetCore.Components/Components/DataGrid/FluentDataGrid.razor.js:173:13) blazor.webassembly.js:1 at Module.init (https://mysite/app/_content/Microsoft.FluentUI.AspNetCore.Components/Components/DataGrid/FluentDataGrid.razor.js:9:5) blazor.webassembly.js:1 at https://mysite/app/_framework/blazor.webassembly.js:1:2878 blazor.webassembly.js:1 at new Promise () blazor.webassembly.js:1 at b.beginInvokeJSFromDotNet (https://mysite/app/_framework/blazor.webassembly.js:1:2835) blazor.webassembly.js:1 at Object.vn [as invokeJSJson] (https://mysite/app/_framework/blazor.webassembly.js:1:58849) blazor.webassembly.js:1 at https://mysite/app/_framework/dotnet.runtime.js:3:178446 blazor.webassembly.js:1 at Ll (https://mysite/app/_framework/dotnet.runtime.js:3:179280)

💁 Possible Solution

Not sure. Haven't had a chance to dig into the source.

🔦 Context

We were in the process of upgrading the application to make use of the new ability to respond to sort events in the FluentDataGrid. This regression is preventing us from upgrading an using the newer features.

🌍 Your Environment

Windows 10, Microsoft Edge, Fluent UI Blazor 4.11.7, net8

czielin avatar Apr 03 '25 16:04 czielin

This must be a cache issue on your side. As you can see on the demo site, resizing is working with the latest version...

As no code to reproduce is provided, we cant investigate further. Standard reply follows...

Please supply us with ready-to-run reproduction code in the form of something we can copy/paste, a (zipped) project structure or a GitHub repository.

We do not have capacity to craft or compose a reproduction for every issue that gets raised.

If no code or repository is provided, this issue will be closed in 3 days

Help us to help you. Thanks.

vnbaaij avatar Apr 03 '25 17:04 vnbaaij

Apologies, I had a minimal code snippet included in the initial write up, and it somehow got lost.

Though despite my mistake you still managed to help. I was running the browser with caching enabled, but it appears the build was holding onto something. Cleaning and rebuilding appears to have fixed it.

Thanks for the direction.

czielin avatar Apr 03 '25 22:04 czielin