5

I am writing a custom NSMenuItem view that I would like to make accessible. When I do not override accessibilityIsIgnored (so the NSView default of YES is returned), I see in Accessibility Inspector that there is a basic AXMenuItem object in the accessibility hierarchy for the menu item using the custom view, but it is missing most of the required attributes for menu items such as "Title":

Screenshot of Accessibility Inspector locked on the AXMenuItem accessibility object, when ignoring accessibility

The required attributes are set for menu items that do not use a custom view.

When I override accessibilityIsIgnored to return NO, then this results in an additional accessibility object being added to the hierarchy (by default an AXUnknown object):

Screenshot of Accessibility Inspector locked on the AXUnknown accessibility object under the AXMenuItem object, when not ignoring accessibility

Attribute values returned by an override of accessibilityAttributeValue: are applied to this AXUnknown object under the AXMenuItem, rather than the desired effect of being applied to the AXMenuItem object itself.

How do I supply the missing attribute values for the menu item?

Daniel Trebbien
  • 38,421
  • 18
  • 121
  • 193
  • Were you able to find a solution? I'm running into similar problems with the new Accessibility API in 10.10 as well. – Fabian Kreiser Mar 20 '15 at 16:58
  • 1
    Hi @FabianKreiser. No, I was not able to find a solution. I ended up filing rdar://18623851 on October 11, 2014. So far I have not received feedback on this report, but I will post a follow-up here if I do. – Daniel Trebbien Mar 20 '15 at 18:29
  • Hello, is there any updates with regards to the above issue? – Ananth Kamath Jan 27 '22 at 15:50

0 Answers0