klembot / twinejs

Twine, a tool for telling interactive, nonlinear stories
https://twinery.org
GNU General Public License v3.0
2k stars 295 forks source link

Passage text can't be edited with the NVDA screen reader #1513

Open Neurrone opened 6 months ago

Neurrone commented 6 months ago

Describe the bug.

I'm using the NVDA screen reader with the desktop application.

When editing passage text, it reads the text in the passage. However, pressing the arrow keys within the edit field to move around does not produce any speech output, making it difficult to work with passage text.

A workaround for this issue is selecting all text, pasting it into a notepad window, editing it then pasting it back into the passage edit field. This works but is definitely not ideal.

Steps to reproduce:

  1. Run the NVDA screen reader
  2. Select a passage and choose edit
  3. Press the arrow keys in the edit field

Expected behavior:

NVDA announces the character under the cursor. Instead, it only reads blank

Additional context on this problem.

I haven't looked at the code in this repository yet, but this issue happens if CodeMirror 5 and below is used for the edit field. Is this the component used for the edit field by any chance?

Twine version number

2.8.1

Does this problem occur with the web version of Twine or the desktop app?

Desktop app

What operating system does this problem occur on?

Windows

If this problem is occurring with the web version of Twine, what browser does it occur on?

None

Presubmission checklist

Neurrone commented 6 months ago

Ah, I see that CodeMirror < 6 is indeed being used in package.json.

Updating to CodeMirror 6 should fix the issue.

klembot commented 6 months ago

Appreciate the feedback! This is a great reason to upgrade to CM 6. It’s something that’s been suggested in the past; the main obstacle is the level of effort involved in upgrading, as it sounds like a CM 6 is a pretty big change from 5.

Neurrone commented 6 months ago

How extensive is the usage of Codemirror? From the migration guide, it seems like it shouldn't be too difficult unless there are plugins or other advanced functionality being used.

klembot commented 6 months ago

@Neurrone we use CodeMirror for passage editors as well as the CSS and JS editor dialog. What adds more complexity is that story formats can now extend Twine using CM modes and commands, so we'd need to update the API for that based on how things work in 6. Docs on this