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 announce the non-editable state of a non-editable JTextField (Java Access Bridge) #13692

Closed
anOolamr opened this issue May 12, 2022 · 1 comment · Fixed by #13706
Milestone

Comments

@anOolamr
Copy link

anOolamr commented May 12, 2022

When moving the keyboard focus to a non-editable JTextField, NVDA does not announce that this JTextField is not editable, although this information is transmitted via the Java Access Bridge. For a non-editable text field, the state "editable" is removed from the AccessibleStateSet.

Non-editable text fields can be used on Graphical User Interfaces to display read-only information which can be changed under certain conditions. The user need to get the state information of a non-editable text field to avoid typing and confusion.

I wrote a simple application Test_JTextField_NotEditable.jar with a frame containing two JTextField objects, an editable one and a non-editable one (including labels), and attached it to this bug report:
Test_JTextField_NotEditable.zip
If you prefer a .java file, you can find it within the .jar file.

Steps to reproduce:

  1. Extract the Test_JTextField_NotEditable.jar file from the linked .zip file.
  2. Execute the attached .jar file with an up-to-date Java Runtime Environment, e.g. JDK/JRE version 17 or 18.
    -> A Java window with title "Frame with two text fields" opens.
    -> The text field with the label "Editable text field" has the keyboard focus.
    -> NVDA announces: "Frame with two text fields, filler, filler, Editable text field, edit, blank"
    ("filler" is the AccessibleRole of the Box. In my opinion, the "filler" announcement is not useful, but this is not the topic of this bug report.)
  3. Press Tab key.
    -> The text field with the label "Read-only text field" has the keyboard focus.
    -> NVDA announces: "Filler, Read-only text field, edit, This text can not be changed".
    -> NVDA does not announce that this text field is not editable.

Actual behavior:

On non-editable text fields, NVDA announces the role "edit" without the non-editable state.

Expected behavior:

On non-editable text fields, NVDA should additionally announce the non-editable state, e.g.: "edit, not editable".

System configuration

NVDA installed/portable/running from source:

installed

NVDA version:

Version: 2021.3.5

Windows version:

Version: 10.0.19042 Build 19042

Name and version of other software in use when reproducing the issue:

java version "18.0.1" 2022-04-19
Java(TM) SE Runtime Environment (build 18.0.1+10-24)
Java HotSpot(TM) 64-Bit Server VM (build 18.0.1+10-24, mixed mode, sharing)

Other information about your system:

Java Access Bridge is enabled.

Other questions

Does the issue still occur after restarting your computer?

Yes.

Have you tried any other versions of NVDA? If so, please report their behaviors.

Yes. Same behavior.

If NVDA add-ons are disabled, is your problem still occurring?

Not applicable.

Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?

Not applicable.

seanbudd pushed a commit that referenced this issue May 19, 2022
Closes #13692

Summary of the issue:
In a Java swing application NVDA does not announce a read only text control as being read only.

Description of how this pull request fixes the issue:
Java Access Bridge does not apply the editable state to read only controls. So when mapping JAB states to NVDA states check whether the control is a text control and whether it lacks the editable state, applying the read only state accordingly.
@nvaccessAuto nvaccessAuto added this to the 2022.2 milestone May 19, 2022
@anOolamr
Copy link
Author

Retested with version 2022.2rc1 by running nvda_2022.2rc1.exe:
Missing state "editable" in AccessibleStateSet is announced as "read only", which means that issue is fixed. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants