MudDataGrid, MudTable: Add TableAttributes parameter - #12993
Conversation
|
Related to #12642, but that issue seems to be specific to the SelectColumn rather than the root table element. |
danielchalmers
left a comment
There was a problem hiding this comment.
Would it be better in general to use aria-labelledby for this as it should already be labeled somewhere on the screen anyway? Or add a TableAttributes property so people can use either one? This could be done in MudTable as well in addition to deprecating the AriaLabel property on there.
|
@danielchalmers Will do. I think the generalized TableAttributes will add more value, so I'll do that. Is there an existing process for deprecating a parameter? I can't find it in the contributing guidelines. |
We typically just mark with Example: [Parameter]
[Category(CategoryTypes.Table.Behavior)]
[Obsolete("Set via TableAttributes....etc")]
public string? AriaLabel { get; set; } |
I can't seem to keep it functional with it marked obsolete, it looks like there are some build rules that throw errors when obsolete parameters are used. Is there a way to get around that? |
Splat the table attributes ahead of the framework class so a stray class/style key in TableAttributes cannot override mud-table-root / TableClassname. Matches the @attributes-before-class convention used across the rest of the library.
|
Thank you! |
Added a
TableAttributesparameter to the MudDataGrid and MudTable that allows for HTML attributes on the underlying table element. This adds support for accessibility features like aria-label and aria-labelledby.Deprecated the
AriaLabelparameter on MudTable, as it can be set by TableAttributes.Checklist: