You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow-up from #423, which added HeaderTemplate to BbDataGridPropertyColumn. Pre-existing gap, not introduced by that change — but #423 makes it much easier to hit.
Problem
BbDataGridHeaderCell sets aria-sort, but the <th> carries no aria-label. Its accessible name therefore comes from its own text content. Title is used for the column chooser and the column menu's aria-labels, but it is not a fallback for the header cell itself.
So a header rendered from a template with no text — the icon-only case that HeaderTemplate exists to enable — produces an unlabelled column for screen reader users:
That works, but it puts the burden on the consumer for something the component already knows, and it fails silently when forgotten — nothing in the UI hints that the column is unlabelled.
Proposal
Have the header cell fall back to aria-label="@Title" when a HeaderTemplate is supplied (or, more simply, whenever Title is set and would otherwise not be the cell's text). The information is already there; it just is not reaching the element.
Worth checking the same question for BbDataGridTemplateColumn.HeaderTemplate, which has the identical shape and the identical exposure.
Care needed not to double-announce when the template does contain text — an aria-label overrides the content, so applying it unconditionally would silence a perfectly good text header and could contradict it. Applying it only when Title is set is probably right, but the behaviour when both Title and template text exist should be decided deliberately.
Follow-up from #423, which added
HeaderTemplatetoBbDataGridPropertyColumn. Pre-existing gap, not introduced by that change — but #423 makes it much easier to hit.Problem
BbDataGridHeaderCellsetsaria-sort, but the<th>carries noaria-label. Its accessible name therefore comes from its own text content.Titleis used for the column chooser and the column menu's aria-labels, but it is not a fallback for the header cell itself.So a header rendered from a template with no text — the icon-only case that
HeaderTemplateexists to enable — produces an unlabelled column for screen reader users:The column announces as empty, despite
Title="Email"being right there and already being used elsewhere for exactly this purpose.Current workaround
Consumers must add screen-reader-only text themselves, which is what the demo and the
HeaderTemplatedocs currently tell them to do:That works, but it puts the burden on the consumer for something the component already knows, and it fails silently when forgotten — nothing in the UI hints that the column is unlabelled.
Proposal
Have the header cell fall back to
aria-label="@Title"when aHeaderTemplateis supplied (or, more simply, wheneverTitleis set and would otherwise not be the cell's text). The information is already there; it just is not reaching the element.Notes
BbDataGridHeaderCell), which is why it was kept out of Enhancement: DataGrid PropertyColumn HeaderTemplate #423.BbDataGridTemplateColumn.HeaderTemplate, which has the identical shape and the identical exposure.aria-labeloverrides the content, so applying it unconditionally would silence a perfectly good text header and could contradict it. Applying it only whenTitleis set is probably right, but the behaviour when bothTitleand template text exist should be decided deliberately.