Fix soft wrap not working due to accessibilitySupport conflict
What does this MR do and why?
Fix soft wrap not working due to accessibilitySupport conflict
Monaco Editor deliberately disables word wrap when
accessibilitySupport is set to "on" because screen readers cannot
properly handle wrapped lines. When a user presses the down arrow in a
wrapped line, screen readers expect to move to the next line, but the
cursor stays on the same model line at a different column, which
confuses screen readers.
GitLab was setting accessibilitySupport: 'on' for all editors, including source_editor.js,
which meant word wrap was always disabled for all users, even those not
using screen readers.
According to the documentation of Monaco editor (see https://github.com/microsoft/monaco-editor/wiki/Accessibility-Guide-for-Integrators point 5), this should only be ever use in an environment where it is 100% possible to tell if a screen reader is used. This is not possible for a web application and shouldn't have been set.
References
- Introduced by !179463 (merged) in GitLab 17.10 to resolve https://gitlab.com/gitlab-org/gitlab/-/issues/511809+
- Resolves #524739 (closed)
- Accessibility Guide for Integrators
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.