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

NVDA does not report disabled menu items as unavailable #10993

Closed
raducoravu opened this issue Apr 13, 2020 · 0 comments · Fixed by #13711
Closed

NVDA does not report disabled menu items as unavailable #10993

raducoravu opened this issue Apr 13, 2020 · 0 comments · Fixed by #13711

Comments

@raducoravu
Copy link

Let's say I have a small Java application with a disabled menu item added to the top level menu:

  /**
   * @param args
   */
  public static void main(String[] args) {
    JFrame fr = new JFrame();
    JMenuBar mb = new JMenuBar();
    JMenu menu = new JMenu("windows");
    JMenuItem mi = new JMenuItem("abc");
    mi.setEnabled(false);
    menu.add(mi);
    mb.add(menu);
    fr.setJMenuBar(mb);
    fr.setSize(500, 500);
    fr.setVisible(true);
  }

NVDA reads the name of the "abc" menu item but it does not report in any way that it is disabled. JAWS on the other side reports the menu item as "unavailable".
I'm using Java 1.8 to run the sample code and using "nvda_2019.3.1"

seanbudd pushed a commit that referenced this issue May 20, 2022
…13711)

Fixes #10993

Summary of the issue:
Controls in Java applications which do not have the enabled state are not being spoken as unavailable by NVDA.

Description of how this pull request fixes the issue:
Java accessibility API states that controls lacking the enabled state cannot be manipulated and normally are shown as greyed out. I understand lacking the enabled state to map to unavailable in NVDA and so this pull request checks if enabled is not present and sets the unavailable state accordingly.
In the (java documentation at https://docs.oracle.com/en/java/javase/17/docs/api/java.desktop/javax/accessibility/AccessibleState.html it says the following for the enabled state:
public static final AccessibleState ENABLED
Indicates this object is enabled. The absence of this state from an object's state set indicates this object is not enabled. An object that is not enabled cannot be manipulated by the user. In a graphical display, it is usually grayed out.
@nvaccessAuto nvaccessAuto added this to the 2022.2 milestone May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants