Skip to content

Commit

Permalink
Fix popup menu item reading on Thunderbird (nvaccess#4708)
Browse files Browse the repository at this point in the history
Summary of the issue:
When the user finds text on Thunderbird by pressing CONTROL+K, searching the text and activating one of the links, NVDA speaks only "section".

Description of user facing changes
NVDA will speak the popup menu item name correctly.

Description of developer facing changes
None.

Description of development approach
Added a check if the object 's name is empty, and is of the "div" tag and has a class of "popup-menuitem", NVDA replaces its name with the name of its child.

Testing strategy:
Performed a manual test with Thunderbird.
  • Loading branch information
thgcode committed Sep 7, 2024
1 parent 7e526e8 commit 8dfb92c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions source/appModules/thunderbird.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,21 @@


class AppModule(appModuleHandler.AppModule):
def _isPopupMenuItem(self, obj):
attributes = getattr(obj, "IA2Attributes", None)

if attributes and "class" in attributes:
tag = attributes["tag"]
classes = attributes["class"].split()
return tag == "div" and "popup-menuitem" in classes

return False

def event_NVDAObject_init(self, obj):
if obj.role == controlTypes.Role.SECTION and not obj.name and self._isPopupMenuItem(obj):
obj.role = controlTypes.Role.MENUITEM
obj.name = obj.IAccessibleObject.accChild(1).accName(0)

def event_gainFocus(self, obj, nextHandler):
if (
obj.role == controlTypes.Role.DOCUMENT
Expand Down

0 comments on commit 8dfb92c

Please sign in to comment.