-
Notifications
You must be signed in to change notification settings - Fork 87
fix: reflect row aria-expanded state for toggle cells #10156
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: reflect row aria-expanded state for toggle cells #10156
Conversation
| * @return {HTMLElement|null} | ||
| * @private | ||
| */ | ||
| __a11yFindTreeToggleCell(row) { |
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.
Let's put this helper function into vaadin-grid-helpers.js since it doesn't depend on the class logic.
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.
Extracted the function.
| _a11yUpdateRowExpanded(row) { | ||
| if (this.__isRowExpandable(row)) { | ||
| row.setAttribute('aria-expanded', 'false'); | ||
| const toggleCell = this.__a11yFindTreeToggleCell(row); |
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.
This variable could be created outside the branches to avoid duplication.
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.
Extracted the line.
Co-authored-by: Sergey Vinogradov <mr.vursen@gmail.com>
|
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.
Tested on Windows with NVDA – works correctly.
|
There's a behavior that I first thought was getting introduced by these changes, but it seems that it is the same when the changes are reverted (I simply made the helper function return row-a11y.mp4 |
I can confirm that as well. |
|
It seems like that issue is browser-specific and does not reproduce on Chrome. In any case, it looks like a separate issue. I will create another one for that and merge this one if it makes sense @DiegoCardoso @vursen |
|
Sounds good to me, especially if it's not related to this change. I wanted to mention it to confirm this finding. |
* refactor: reflect row aria-expanded state for toggle cells * refactor: get toggle cell once to avoid duplication * refactor: extract logic for finding toggle cell into helper * Update packages/grid/src/vaadin-grid-helpers.js Co-authored-by: Sergey Vinogradov <mr.vursen@gmail.com> --------- Co-authored-by: Sergey Vinogradov <mr.vursen@gmail.com>
* refactor: reflect row aria-expanded state for toggle cells * refactor: get toggle cell once to avoid duplication * refactor: extract logic for finding toggle cell into helper * Update packages/grid/src/vaadin-grid-helpers.js Co-authored-by: Sergey Vinogradov <mr.vursen@gmail.com> --------- Co-authored-by: Sergey Vinogradov <mr.vursen@gmail.com>
|
This ticket/PR has been released with Vaadin 25.0.0-alpha12. |




Description
When cell focus mode is active and the row is expanded/collapsed via Space key, the state change is not announced for NVDA and VoiceOver.
This PR reflects the row
aria-expandedstate to the toggle cells so that the announcements in cell focus mode works correctly.Fixes #5791
Type of change
Checklist