-
Notifications
You must be signed in to change notification settings - Fork 406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: HeaderCellAsButtonWithMenu and ColumnOptions set but no sorting results in no menu shown #3309
Labels
closed:done
Work is finished
Comments
Fix with PR mentioned |
On further investigation, this is not the correct fix for this bug. There are 4 render states for menu:
private async Task HandleColumnHeaderClickedAsync()
{
if ((Sortable is true || IsDefaultSortColumn) && (Grid.ResizableColumns || ColumnOptions is not null))
{
_isMenuOpen = !_isMenuOpen;
}
else if ((Sortable is true || IsDefaultSortColumn) && !Grid.ResizableColumns && ColumnOptions is null)
{
await Grid.SortByColumnAsync(this);
}
else if (Sortable is not true && !IsDefaultSortColumn && ColumnOptions is null && Grid.ResizableColumns)
{
await Grid.ShowColumnResizeAsync(this);
}
} --> private async Task HandleColumnHeaderClickedAsync()
{
var hasSorting = Sortable is true || IsDefaultSortColumn;
var hasResize = Grid.ResizableColumns;
var hasOptions = ColumnOptions is not null;
var hasMulti = (hasSorting && hasResize) || (hasSorting && hasOptions) || (hasResize && hasOptions);
if (hasMulti) { _isMenuOpen = !_isMenuOpen; }
else if (hasSorting) { await Grid.SortByColumnAsync(this); }
else if (hasResize) { await Grid.ShowColumnResizeAsync(this); }
else if (hasOptions) { await Grid.ShowColumnOptionsAsync(this); }
} |
That looks much clearer! Although our style rules will trigger on your formatting 😜
PR was mergedalready. I'll create a new one. |
dvoituron
pushed a commit
that referenced
this issue
Feb 7, 2025
vnbaaij
added a commit
that referenced
this issue
Feb 7, 2025
vnbaaij
added a commit
that referenced
this issue
Feb 7, 2025
* - Do not add global.json to repo - Fix #3306 by accounting for Sortable being null - Fix #3309 by adding a StateHasChanged * - Cleanup issueTester - Tune column/style behavior - Fix tests * - Refactor code that determines if column menu needs to be shown - Refactor code that determines if header gets display:flex - Do not show filter icon when using 'clasic' filter option button - Fix more edge cases in displaying headers * Cleanup IssueTester * Fix tests
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🐛 Bug Report
fluentui-blazor/src/Core/Components/DataGrid/Columns/ColumnBase.razor.cs
Lines 250 to 253 in e6e151c
StateHasChanged
and thus the menu is never shown.💻 Repro or Code Sample
🤔 Expected Behavior
clicking on TemplateColumn header shows
Column Options
andresize
.😯 Current Behavior
Nothing happens on click
💁 Possible Solution
Call
StateHasChanged
after changing property.The text was updated successfully, but these errors were encountered: