Skip to content
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 popup menu item reading on Thunderbird #17130

Merged
merged 3 commits into from
Sep 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: NVDAObject):
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: NVDAObject):
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
1 change: 1 addition & 0 deletions user_docs/en/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ In order to use this feature, the application volume adjuster needs to be enable
* Improvements when editing in Microsoft PowerPoint:
* Caret reporting no longer breaks when text contains wide characters, such as emoji. (#17006 , @LeonarddeR)
* Character location reporting is now accurate (e.g. when pressing `NVDA+Delete`. (#9941, @LeonarddeR)
* NVDA is able to read the popup submenu items on Thunderbird search results page. (#4708, @thgcode)

### Changes for Developers

Expand Down