microsoft / fluentui-blazor

Microsoft Fluent UI Blazor components library. For use with ASP.NET Core Blazor applications
https://www.fluentui-blazor.net
MIT License
3.65k stars 350 forks source link

FluentDataGrid - column resizing with additional unwanted effects #2381

Closed gryzorr closed 1 month ago

gryzorr commented 2 months ago

🐛 Bug Report

When resizing FluentDataGrid column at the beginning width of current column gets smaller and all previous one shrinks also a little.

💻 Repro or Code Sample

See video and attachment.

🤔 Expected Behavior

When starting resize operation previous columns and current one should not shrink.

😯 Current Behavior

Each time user starts resize column (very little move to right to start enlarge column) all columns to the left shrinks causing that current column gets smaller on start (resize cursor doesn't match column separator). When there is more columns and user repeats operation for more than one column sometimes prevoius one need correction and so on.

💁 Possible Solution

beyond my capabilities :-)

🔦 Context

Minor problem (at the moment we use components only for internal app) but nice to have a solution.

🌍 Your Environment

https://github.com/user-attachments/assets/873ed6b8-c984-4a72-bf3e-353aff7b78a9

gryzorr commented 2 months ago

And ofcourse example code. BlazorAppTest.zip

michaelc06 commented 1 month ago

Can confirm noticing the same issues. Repeatable on https://www.fluentui-blazor.net/DataGrid -> Typical usage

f4n0 commented 1 month ago

Same here: Live: https://f4n0.github.io/BlazorGenerator/list Code: https://github.com/f4n0/BlazorGenerator/tree/master/BlazorGenerator/Components/DataGrid

f4n0 commented 1 month ago

Hi, @vnbaaij ! I've tried something. by editing the js function to use % values instead of px values, it seems to work better. but I don't think that could be the real fix to the issue

vnbaaij commented 1 month ago

I think it has to do with conversion of fractions to pixels. Not sure if we can do anything about that.

Considering this as a minimum impact issue which I will not spend too much time on.

I labeled this as a community issue. Someone interested in solving this can pick it up. If no one responds, I will close this in about a week.

f4n0 commented 1 month ago

Well, I don't really think that this is a minimum impact issue. The column resizing of a table it's an essential feature, and this need to work. The end user uses this functionality practically every day!

For my app, if you resize the table multiple times, the select column will disappear!

EDIT: Why is fluentui-blazor resizing columns via grid template column? why not the width parameter?

vnbaaij commented 1 month ago

Well, I don't really think that this is a minimum impact issue. The column resizing of a table it's an essential feature, and this need to work. The end user uses this functionality practically every day!

You make it sound as if it does not work at all. I'm just saying that is not the case. Resizing is possible but has some visible quirks. Please understand we have a limited amount of time to work on this. There are more grave issues we need to work on.

For my app, if you resize the table multiple times, the select column will disappear!

That is something we definitely need to look at.

EDIT: Why is fluentui-blazor resizing columns via grid template column? why not the width parameter?

Because the underlying web components automatically populate and use the grid template columns value

Thank you for your PR!! We will test and verify that one soon.