-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
feat: Allow more lines in hidden textarea to improve screen reader experience on Windows #5225
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #5225 +/- ##
=======================================
Coverage 87.23% 87.23%
=======================================
Files 565 565
Lines 45248 45288 +40
Branches 6920 6929 +9
=======================================
+ Hits 39470 39508 +38
- Misses 5778 5780 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
This does seem to improve screen reader compatibility, |
if (value){ | ||
this.renderer.enableKeyboardAccessibility = true; | ||
this.renderer.keyboardFocusClassName = "ace_keyboard-focus"; | ||
|
||
this.textInput.getElement().setAttribute("tabindex", -1); | ||
// VoiceOver on Mac OS works best with single line in the textarea, the screen readers on | ||
// Windows work best with multiple lines in the textarea. | ||
this.textInput.setNumberOfExtraLines(useragent.isWin ? 3 : 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about linux?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question, I don't have quick access to a Linux desktop so I couldn't test this so I didn't want to change anything for Linux. The most used screen reader on Linux seems to be orca.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried on Ubuntu with orca, and to be honest, it's not great with either option but it's better without the extra lines in the textarea (like it is currently in this PR).
Issue #, if available: #2164
Description of changes: Some Windows browsers and screen readers have trouble reading the content in the hidden textarea when navigating up/down.
This change allows more lines of text into the textarea to allow to improve the screen reader experience (without changing the default behavior).
This allows the cursor in the textarea to move lines up/down which makes the behavior in the hidden textarea closer to a 'normal' textarea. Monaco uses a similar approach and is generally considered to be ahead of Ace when it comes to screen reader compatibility.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.