-
Notifications
You must be signed in to change notification settings - Fork 87
fix: adjust row and col count base on Grid state #9872
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
Conversation
Apply some adjustments to how the `aria-rowcount`/`aria-colcount` values are measured. The changes in this PR are: - Fix the wrong usage of `headerRenderer` at the method responsible of counting the number of footer rows - Add a call to `_a11yUpdateGridSize` in the `__updateHeaderFooterRowVisibility` method to recalculate the number of rows/cols when the renderers change - If empty-state is used and it's active, it is counted as a row - If the grid has no items and no header/footer is rendered, then the number of columns is adjusted accordingly Fixes #9081
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes accessibility issues in the Grid component by correcting how aria-rowcount
and aria-colcount
values are calculated based on the grid's state, including header/footer visibility and empty state handling.
- Fixed incorrect method call for counting footer rows (was using
headerRenderer
instead offooterRenderer
) - Added grid size recalculation when header/footer visibility changes
- Improved column count calculation to handle empty state scenarios appropriately
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
packages/grid/src/vaadin-grid-a11y-mixin.js | Fixed footer row counting bug and improved aria-rowcount/aria-colcount calculation logic with empty state support |
packages/grid/src/vaadin-grid-mixin.js | Added call to recalculate grid size when header/footer visibility changes |
packages/grid/test/accessibility.test.js | Added test cases to verify correct aria attribute values in various grid states |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
} | ||
|
||
/** @private */ | ||
_a11yUpdateGridSize(size, _columnTree) { | ||
_a11yUpdateGridSize(size, _columnTree, __emptyState) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_a11yUpdateGridSize(size, _columnTree, __emptyState) { | |
_a11yUpdateGridSize(size, _columnTree, emptyState) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 33c75a2.
f09c068
to
33c75a2
Compare
|
… (#9891) Co-authored-by: Diego Cardoso <diego@vaadin.com>
… (#9892) Co-authored-by: Diego Cardoso <diego@vaadin.com>
Description
Apply some adjustments to how the
aria-rowcount
/aria-colcount
values are measured. The changes in this PR are:headerRenderer
at the method responsible of counting the number of footer rows_a11yUpdateGridSize
in the__updateHeaderFooterRowVisibility
method to recalculate the number of rows/cols when the renderers changeBelow is a table with the possible states and how the amount of
aria-rowcount
andaria-colcount
are reflected:B: is the number of body rows, H of header rows, and F of footer rows
aria-rowcount
aria-colcount
Fixes #9081
Type of change