fix: announce all content inside role="alert"#20056
Open
mehm8128 wants to merge 2 commits intonvaccess:masterfrom
Open
fix: announce all content inside role="alert"#20056mehm8128 wants to merge 2 commits intonvaccess:masterfrom
role="alert"#20056mehm8128 wants to merge 2 commits intonvaccess:masterfrom
Conversation
Contributor
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. |
| speech.speakObject(child, reason=controlTypes.OutputReason.FOCUS, priority=speech.Spri.NOW) | ||
| braille.handler.message(braille.getPropertiesBraille(name=self.name, role=self.role)) | ||
| speech.speakObject(child, reason=controlTypes.OutputReason.FOCUS, priority=speech.Spri.NOW) | ||
| braille.handler.message(braille.getPropertiesBraille(name=self.name, role=self.role)) |
Author
There was a problem hiding this comment.
fixed even though this had been happening since before this PR
| speech.speakObject(child, reason=controlTypes.OutputReason.FOCUS, priority=speech.Spri.NOW) | ||
| braille.handler.message(braille.getPropertiesBraille(name=self.name, role=self.role)) | ||
| speech.speakObject(child, reason=controlTypes.OutputReason.FOCUS, priority=speech.Spri.NOW) | ||
| braille.handler.message(braille.getPropertiesBraille(name=self.name, role=self.role)) |
seanbudd
reviewed
May 8, 2026
| speech.speakObject(self, reason=controlTypes.OutputReason.FOCUS, priority=speech.Spri.NOW) | ||
| braille.handler.message(braille.getPropertiesBraille(name=self.name, role=self.role)) | ||
| for child in self.recursiveDescendants: | ||
| if controlTypes.State.FOCUSABLE in child.states: |
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 removed
ifconditional branch, so all children contents will be announced.This was introduced in mehm8128@370d052 18 years ago, but
is not correct now, this causes the issue I fixed for this PR, so I removed
ifconditional branch.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: