diff --git a/source/NVDAObjects/IAccessible/__init__.py b/source/NVDAObjects/IAccessible/__init__.py index 4f9a67f09c3..86dee18b09f 100644 --- a/source/NVDAObjects/IAccessible/__init__.py +++ b/source/NVDAObjects/IAccessible/__init__.py @@ -2038,8 +2038,27 @@ def event_alert(self) -> None: return speech.speakObject(self, reason=controlTypes.OutputReason.FOCUS, priority=speech.Spri.NOW) braille.handler.message(braille.getPropertiesBraille(name=self.name, role=self.role)) + hasDescription = bool(self.description) for child in self.recursiveDescendants: - if controlTypes.State.FOCUSABLE in child.states: + isFocusable = controlTypes.State.FOCUSABLE in child.states + if hasDescription and not isFocusable: + shouldSpeak = isFocusable + else: + shouldSpeak = ( + isFocusable + or child.role + in ( + controlTypes.Role.HEADING, + controlTypes.Role.LIST, + controlTypes.Role.LISTITEM, + ) + or ( + child.role == controlTypes.Role.STATICTEXT + and child.parent is not None + and child.parent.role == controlTypes.Role.PARAGRAPH + ) + ) + if shouldSpeak: speech.speakObject(child, reason=controlTypes.OutputReason.FOCUS, priority=speech.Spri.NOW) braille.handler.message(braille.getPropertiesBraille(name=self.name, role=self.role)) diff --git a/user_docs/en/changes.md b/user_docs/en/changes.md index 2a5a731571d..ae1918c9f75 100644 --- a/user_docs/en/changes.md +++ b/user_docs/en/changes.md @@ -20,6 +20,7 @@ * Reduced lag on UI Automation text change events, improving the responsiveness of controls such as combo boxes and of File Explorer, by using the cached element class name instead of a live cross-process fetch. (#16749, @heath-toby) * NVDA recovers more quickly when an application stops responding; in particular, switching away from a hung application returns NVDA to responsiveness immediately. (#20169, @heath-toby) * In Mozilla Firefox, reporting annotation details now works correctly in focus mode on controls which are not editable text. (#20208, @jcsteh) +* NVDA now announces heading, paragraph, list, and list item children inside `role="alert"` elements. (#14990, @mehm8128) ### Changes for Developers