MudBlazor/MudBlazor

MudTable not showing grouped rows correctly when dynamically setting groupings

Ouverte

#10 094 ouverte le 25 oct. 2024

 (2 commentaires) (0 réaction) (0 personne assignée)C# (1 631 forks)batch import
bughelp wanted

Métriques du dépôt

Stars
 (10 394 étoiles)
Métriques de merge PR
 (Merge moyen 6j 6h) (108 PRs mergées en 30 j)

Description

Things to check

  • I have searched the existing issues for this bug
  • To rule out a caching problem I made sure the bug also happens in an incognito tab

Bug type

Component

Component name

MudTableGroupRow

What happened?

I have a table where I can dynamically select on which columns I want to group. Every time a new column is selected a grouping for that column is added and for multiple columns they are recursively nested in the InnerGroup field. I created a simpler version of this table for demonstration purposes:

You can select which columns to group by with the chips above the table, when selecting and deselecting a single column, there is no issue. But whenever you start selecting multiple columns to group by some issues arise. A message is shown "There aren't any group definition to use with this component." when selecting multiple columns for grouping and then deselecting one or more of these columns (not all of them).

I have traced this back to this line, but I feel like the correct groupings should still be shown. (also see the code example below for more info)

I presume this has something to do with the fact that TableGroupDefinition has nested values but it is of itself only a single reference, maybe Blazor doesn't know how to correctly update the DOM whenever the values are updated because of this maybe?

Expected behavior

I expect the TableGroupDefinition to update accordingly and the table not to display any unexpected messages.

Reproduction link

https://try.mudblazor.com/snippet/waGovacfxxnaPAHt

Reproduction steps

  1. First select 2 or more columns to group by.
  2. Expand the rows so that you can see some table values
  3. Deselect one of the selected group rows.

Relevant log output

No response

Version (bug)

7

Version (working)

No response

What browsers are you seeing the problem on?

Chrome

On which operating systems are you experiencing the issue?

Windows

Pull Request

  • I would like to do a Pull Request

Code of Conduct

  • I agree to follow this project's Code of Conduct

Guide contributeur