fix: announce all content inside role="alert"#20056
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes NVDA’s handling of HTML/ARIA role="alert" so that alert events announce the full contents of the alert container (not just focusable descendants), addressing #14990.
Changes:
- Update IAccessible alert event handling to speak all recursive descendants of an alert container.
- Add a user-facing changelog entry noting improved
role="alert"announcements.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
source/NVDAObjects/IAccessible/__init__.py |
Expands alert announcement logic to iterate through and announce all descendant content. |
user_docs/en/changes.md |
Documents the user-facing change for role="alert" announcements. |
e20ded3 to
8989eb8
Compare
0853cd2 to
4e09548
Compare
Qchristensen
left a comment
There was a problem hiding this comment.
changes.md line reads well.
|
can you merge in latest master please? |
|
There may be some double speaking if the author of the HTML does the right thing and sets aria-description or aria-describedby. Have you tested this case? If there's double speaking, can you consider adding a filter to check if the description is there and therefore just do focusable children like now. |
|
I confirmed that the double speaking occurs, so I fixed it as you suggested. |
|
please merge in the latest master as requested previously. Otherwise unrelated changes will continue to show up in the diff |
a286f46 to
0e5565c
Compare
|
Sorry, I had overlooked that. I rebased the latest master. |
Link to issue number:
close #14990
Summary of the issue:
The content of HTML element with
role="alert"had only announced its focusable children contents.Description of user facing changes:
NVDA now announces all content inside
role="alert"elements.Description of developer facing changes:
Description of development approach:
I extended the condition of what role is announced. I added heading, list, listitem, and paragraph roles.
Testing strategy:
test with sample code described in the original issue and confirm that all contents inside
role="alert"are announced.on both Chromium and Firefox, it performs as expected.
Known issues with pull request:
Code Review Checklist: