Skip to content

NVDA does not announce the multi-line state and the complete multi-line text of a JTextArea (JAB) #14609

Closed

Description

If a JTextArea with a longer, multi-line gets the keyboard focus, NVDA does not read the complete text, but only the first line of the text. This is confusing, in particular if the first sentence has more than one line or if the text is not editable and the information needs to be announced as a whole. As NVDA does not announce the multi-line state of the JTextArea, the user does not get the information that the text can have more than one line. I would expect that NVDA announces the multi-line state and starts reading the complete text of a JTextArea (according to the NVDA announcement of an e-mail message). The user can easily stop the text reading by pressing Ctrl key.

I wrote a simple application Test_JTextArea_with_multilineText.jar and attached it to this bug report. (If you prefer a .java file, you can find it within the .jar file.)
Test_JTextArea_with_multilineText.zip

Steps to reproduce:

Extract the Test_JTextArea_with_multilineText.jar file from the linked .zip file and execute the attached .jar file with an up-to-date JRE version.

The application opens a frame containing a labeled JTextField and a labeled JTextArea. The text field has a single-line text whereas the text area has a longer, multi-line text. Both, the text field and the text area are not editable.

After starting the application, the following (see Actual behavior) is announced by NVDA.

Actual behavior:

Single-line and multi-line text
filler
filler
Single-line text: edit read only This is a text
tab
filler
Multi-line text: edit read only This is the first part of a
down arrow
longer text. This is the
down arrow
second part of a longer
down arrow
text. This is the third part
down arrow
of a longer text. This is the
down arrow
fourth part of a longer text.
down arrow
fourth part of a longer text.
down arrow
This is the last part of a
down arrow
This is the last part of a
down arrow
This is the last part of a
down arrow
This is the last part of a

(NVDA has an additional issue reading the last sentence completely.)

Expected behavior:

tab
Multi-line text: edit read only multi-line This is the first part of a longer text. This is the
second part of a longer text. This is the third part of a longer text. This is the fourth part of a longer text. This is the last part of a longer text.

NVDA logs, crash dumps and other attachments:

System configuration

NVDA installed/portable/running from source:

installed

NVDA version:

[Window Title]
About NVDA

[Content]
Version: 2022.4 (2022.4.0.27401)

Windows version:

Microsoft Windows 10 Enterprise
Version 10.0.19044 Build 19044

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

java version "17.0.6" 2023-01-17 LTS
Java(TM) SE Runtime Environment (build 17.0.6+9-LTS-190)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.6+9-LTS-190, 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.

Same behavior in previous versions of NVDA.

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.

Activity

  1. michaelDCurran commented on Feb 9, 2023

    @michaelDCurran
    Member

    NVDA does seem to map the Java accessibility multi_line state to NvDA's multiline state.
    So I'm guessing that this particular Swing control does not expose the multi_line state?
    @mwhapples do you have any thoughts?

  2. added
    p3https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority
    triagedHas been triaged, issue is waiting for implementation.
    on Feb 12, 2023
  3. benjschneider commented on Jul 29, 2023

    @benjschneider

    I am running into the same issue. I have a JTextArea showing multiple lines of text and NVDA reads them line by line rather than one continuous block of text.

    According to jaccessinspector the component reports the multiple line state as expected (@anOolamr).

    Is this a bug in NVDA? I am happy to send a PR if someone points me into the right direction of where to fix this.

  4. dmitrii-drobotov commented on Oct 2, 2023

    @dmitrii-drobotov
    Contributor

    I've made a PR with a fix for not properly detecting multiline state with JAB: #15557.

    NVDA still reads only the first line, but it matches how other multi-line readonly edits are read (e.g. NVDA Speech Viewer). The problem is that Java's AccessibleRole.TEXT is always mapped to NVDA's Role.EDITABLETEXT, while not editable JTextArea is a plain text component and should probably be mapped to Role.STATICTEXT. Unfortunately, Java doesn't have two different roles for editable and plain texts, so from the NVDA's side, it might not be simple to distinguish read-only edit text (like NVDA Speech Viewer with caret and selection) and plain text.

  5. added this to the 2024.1 milestone on Oct 3, 2023
  6. added a commit that references this issue on Oct 3, 2023
    2adb77c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    component/java-access-bridgep3https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#prioritytriagedHas been triaged, issue is waiting for implementation.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions