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

Unable to select text with screen reader #4656

Closed
JasonXJ opened this issue Aug 10, 2023 · 4 comments · Fixed by #4742
Closed

Unable to select text with screen reader #4656

JasonXJ opened this issue Aug 10, 2023 · 4 comments · Fixed by #4742
Assignees
Labels
area/accessibility help wanted type/enhancement Features or improvements to existing features
Milestone

Comments

@JasonXJ
Copy link

JasonXJ commented Aug 10, 2023

Details

  • OS version: ChromeOS (but this is probably not limit to ChromeOS)
  • xterm.js version: ToT

The .xterm-accessibility-tree element (and everything else within .xterm) has the css variable user-select set to none, so ChromeVox (and probably the screenreader on other platforms) is only able to select the row element but not the text inside it. The user is also not able to copy the text because of this.

I think the solution to this is:

  1. override user-select for .xterm-accessibility-tree so that the text is selectable. We will also use css to hide the browser selection highlight.
  2. Monitor the selectionchange event for the element, and sync the selection to the terminal (e.g. via term.select())

What do you think about this?

@Tyriar
Copy link
Member

Tyriar commented Aug 10, 2023

We may just be able to remove the user-select CSS rules when screen reader mode is on. The main thing we need to make sure still works is mouse selection and links and since pointer-events:none is on the accessibility tree it'll probably be fine.

Monitor the selectionchange event for the element, and sync the selection to the terminal (e.g. via term.select())

Is this needed? You would be using a screen reader to select the DOM element so you don't need the "native" xterm.js selection do you?

@Tyriar Tyriar added type/proposal A proposal that needs some discussion before proceeding area/accessibility labels Aug 10, 2023
@JasonXJ
Copy link
Author

JasonXJ commented Aug 14, 2023

Hi Tyriar, the a11y tree element is only supposed to interact with the screen reader. It is not supposed to be seen by the user (we currently hide it by setting css color to transparent). I beleve we don't want to change this when we allow user-select on the tree, because otherwise the user will see a selected text overlay on top of the canvas:

Screenshot 2023-08-14 11 27 32 AM

This is why I propose also hiding the selection with css, but sync the "native" xterm.js selection so that the canvas can be painted correctly. Does this make sense?

@Tyriar
Copy link
Member

Tyriar commented Aug 14, 2023

That sounds reasonable, provided it doesn't impact the experience in non-screenReaderMode

@Tyriar Tyriar added type/enhancement Features or improvements to existing features help wanted and removed type/proposal A proposal that needs some discussion before proceeding labels Aug 14, 2023
@JasonXJ
Copy link
Author

JasonXJ commented Aug 23, 2023

I don't think anyone is working on this. I am planning to work on this in the coming days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/accessibility help wanted type/enhancement Features or improvements to existing features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants